From de415ad907640c2dc4f06c59dd7a4d9f9b43f49e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Mon, 1 Apr 2024 20:18:16 +0200 Subject: [PATCH] First tentative version of a blog --- config.yaml | 3 +- content/blog/_index.md | 15 ++++++++ content/blog/test01.md | 10 ++++++ content/blog/test02.md | 10 ++++++ content/blog/test_long.md | 9 +++++ layouts/blog/list.html | 16 +++++++++ layouts/partials/blog/entry_list.html | 13 +++++++ scss/_blog.scss | 52 +++++++++++++++++++++++++++ scss/style.scss | 1 + static/css/style.css | 36 +++++++++++++++++++ 10 files changed, 163 insertions(+), 2 deletions(-) create mode 100644 content/blog/_index.md create mode 100644 content/blog/test01.md create mode 100644 content/blog/test02.md create mode 100644 content/blog/test_long.md create mode 100644 layouts/blog/list.html create mode 100644 layouts/partials/blog/entry_list.html create mode 100644 scss/_blog.scss diff --git a/config.yaml b/config.yaml index 49103f1..7b052df 100644 --- a/config.yaml +++ b/config.yaml @@ -9,8 +9,7 @@ params: siteLicenseName: "GNU GPLv3" taxonomies: - category: categories - tag: tags + blog_tag: 'blog/tags' privacy: disqus: diff --git a/content/blog/_index.md b/content/blog/_index.md new file mode 100644 index 0000000..f2ce5a0 --- /dev/null +++ b/content/blog/_index.md @@ -0,0 +1,15 @@ +--- +title: "Blog" +date: 2024-04-01 +draft: false +type: blog + +menu: + main: + weight: 150 +--- + +This blog is an eclectic collection of things I thought deserved to be written +up and recorded. It may (or may never) include the way I set up some services +for system administration, things I struggled to find, cool dev tricks, or +whatever crosses my mind (and, hopefully, was helpful). diff --git a/content/blog/test01.md b/content/blog/test01.md new file mode 100644 index 0000000..9481abd --- /dev/null +++ b/content/blog/test01.md @@ -0,0 +1,10 @@ +--- +title: Test 1 +date: 2023-04-01 +draft: true +"blog/tags": +- test +- misc +--- + +Bonjour, ceci est un test. diff --git a/content/blog/test02.md b/content/blog/test02.md new file mode 100644 index 0000000..e37c6e2 --- /dev/null +++ b/content/blog/test02.md @@ -0,0 +1,10 @@ +--- +title: Test 2 +date: 2023-05-02 +draft: true +"blog/tags": +- test +- second +--- + +Bonjour, ceci est également un test. diff --git a/content/blog/test_long.md b/content/blog/test_long.md new file mode 100644 index 0000000..612be5d --- /dev/null +++ b/content/blog/test_long.md @@ -0,0 +1,9 @@ +--- +title: Ceci, par rapport aux autres, est un test avec un titre d'une longueur fort surprenante. +date: 2023-05-12 +draft: true +"blog/tags": +- test +--- + +Bonjour, ceci est également un test. diff --git a/layouts/blog/list.html b/layouts/blog/list.html new file mode 100644 index 0000000..cf49de2 --- /dev/null +++ b/layouts/blog/list.html @@ -0,0 +1,16 @@ +{{ define "profilepic" }}
{{ end }} + +{{ define "pagename" }} +

{{ .Title }}

+{{ end }} + +{{ define "main" }} + {{ .Content }} + +
+ {{ range .Pages }} + {{ partial "blog/entry_list.html" . }} +
+ {{ end }} +
+{{ end }} diff --git a/layouts/partials/blog/entry_list.html b/layouts/partials/blog/entry_list.html new file mode 100644 index 0000000..5fd4dc2 --- /dev/null +++ b/layouts/partials/blog/entry_list.html @@ -0,0 +1,13 @@ +
+
+ {{ .Title }} + +
+ {{ with .GetTerms "blog/tags" }} +
diff --git a/scss/_blog.scss b/scss/_blog.scss new file mode 100644 index 0000000..8d8118f --- /dev/null +++ b/scss/_blog.scss @@ -0,0 +1,52 @@ +// vim: tabstop=2 shiftwidth=2 expandtab + +@import 'params'; + +#entries { + .blog_entry { + padding: 15px 0; + .blog_entry_descr { + display: flex; + justify-content: space-between; + align-items: flex-start; + gap: 10px; + + .blog_entry_title { + display: block; + font-size: 1.1em; + text-align: left; + } + .blog_entry_date { + color: $fg_color_light; + font-style: italic; + display: block; + align-self: flex-start; + } + } + .blog_entry_tags::before { + content: "Tags:" + } + .blog_entry_tags { + list-style: none; + padding-left: 0; + margin: 5px 0; + font-size: 0.9em; + li { + display: inline; + font-style: italic; + } + li ~ li::before { + content: ", "; + } + } + } + + hr { + width: 80%; + border-color: $fg_color_light; + } + + hr:last-child { + display: none; + } +} diff --git a/scss/style.scss b/scss/style.scss index 76e0880..ee7adfe 100644 --- a/scss/style.scss +++ b/scss/style.scss @@ -2,6 +2,7 @@ @import url('fonts.css'); @import 'params'; +@import 'blog'; html { background-color: $bg_color; diff --git a/static/css/style.css b/static/css/style.css index 147df14..600e401 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -1,5 +1,41 @@ @charset "UTF-8"; @import url("fonts.css"); +#entries .blog_entry { + padding: 15px 0; } + #entries .blog_entry .blog_entry_descr { + display: flex; + justify-content: space-between; + align-items: flex-start; + gap: 10px; } + #entries .blog_entry .blog_entry_descr .blog_entry_title { + display: block; + font-size: 1.1em; + text-align: left; } + #entries .blog_entry .blog_entry_descr .blog_entry_date { + color: #555555bb; + font-style: italic; + display: block; + align-self: flex-start; } + #entries .blog_entry .blog_entry_tags::before { + content: "Tags:"; } + #entries .blog_entry .blog_entry_tags { + list-style: none; + padding-left: 0; + margin: 5px 0; + font-size: 0.9em; } + #entries .blog_entry .blog_entry_tags li { + display: inline; + font-style: italic; } + #entries .blog_entry .blog_entry_tags li ~ li::before { + content: ", "; } + +#entries hr { + width: 80%; + border-color: #555555bb; } + +#entries hr:last-child { + display: none; } + html { background-color: white; }