From b57796b7b5cb413ef0675833b758538acde246ce Mon Sep 17 00:00:00 2001 From: Lol3rrr Date: Sun, 4 Oct 2026 19:35:12 +0200 Subject: [PATCH] Add configuration to have post series for things like quickfacts and upcoming reversi --- content/quickfacts-1/index.md | 2 ++ content/quickfacts-automata/index.md | 2 ++ content/quickfacts-intro/index.md | 2 ++ templates/macros/post_macros.html | 8 ++++++++ templates/page.html | 20 +++++++++++++++++++ templates/series/list.html | 29 ++++++++++++++++++++++++++++ templates/series/single.html | 23 ++++++++++++++++++++++ zola.toml | 3 +++ 8 files changed, 89 insertions(+) create mode 100644 templates/page.html create mode 100644 templates/series/list.html create mode 100644 templates/series/single.html diff --git a/content/quickfacts-1/index.md b/content/quickfacts-1/index.md index 1146dd2..1aae083 100644 --- a/content/quickfacts-1/index.md +++ b/content/quickfacts-1/index.md @@ -7,9 +7,11 @@ draft = true [taxonomies] categories = ["Programming"] tags = ["Factorio", "Rust"] +series = ["quickfacts"] [extra] toc = true +series_order = 3 +++ The first real entry in my series about my quickfacts project. diff --git a/content/quickfacts-automata/index.md b/content/quickfacts-automata/index.md index f9ae955..9c1dff3 100644 --- a/content/quickfacts-automata/index.md +++ b/content/quickfacts-automata/index.md @@ -7,9 +7,11 @@ draft = true [taxonomies] categories = ["Programming"] tags = ["Factorio", "Rust"] +series = ["quickfacts"] [extra] toc = true +series_order = 2 +++ Testing diff --git a/content/quickfacts-intro/index.md b/content/quickfacts-intro/index.md index 4eb7529..198d598 100644 --- a/content/quickfacts-intro/index.md +++ b/content/quickfacts-intro/index.md @@ -7,9 +7,11 @@ draft = true [taxonomies] categories = ["Programming"] tags = ["Factorio", "Rust", "Quickfacts"] +series = ["quickfacts"] [extra] toc = true +series_order = 1 +++ A small introduction to my ongoing quickfacts project. diff --git a/templates/macros/post_macros.html b/templates/macros/post_macros.html index bab6bc4..5c84f1e 100644 --- a/templates/macros/post_macros.html +++ b/templates/macros/post_macros.html @@ -13,6 +13,14 @@ {% if page.date %}Published: {{ page.date | date(format="%F") }}{% endif %} + + {% if page.taxonomies.series %} +
+ {% set series_name = page.taxonomies.series | first %} + {% set series_term = get_taxonomy_term(kind="series", term=series_name) %} + + Part {{ page.extra.series_order }} of the {{ series_name }} series + {% endif %} {% endmacro meta %} {% macro page_in_list(page) %} diff --git a/templates/page.html b/templates/page.html new file mode 100644 index 0000000..b3d3945 --- /dev/null +++ b/templates/page.html @@ -0,0 +1,20 @@ +{% extends "radion/templates/page.html" %} + +{% block header %} + {{ super() }} + + {% if page.taxonomies.series %} + {% set series_name = page.taxonomies.series | first %} + {% set series_term = get_taxonomy_term(kind="series", term=series_name) %} + +
+ + Series: {{ series_term.name }} + + + {% if page.extra.series_order %} + ยท Part {{ page.extra.series_order }} + {% endif %} +
+{% endif %} +{% endblock header %} diff --git a/templates/series/list.html b/templates/series/list.html new file mode 100644 index 0000000..0f62347 --- /dev/null +++ b/templates/series/list.html @@ -0,0 +1,29 @@ +{% extends "index.html" %} + +{% block title %}Browse Series{% endblock title %} +{% block og_title %}Browse Series{% endblock og_title %} +{% block twitter_title %}Browse Series{% endblock twitter_title %} + +{% block meta_description %} + + + +{% endblock meta_description %} + +{% block content %} + {% block header %} + {{ super() }} + {% endblock header %} + +

Series

+ + {% if terms %} + + {% endif %} +{% endblock content %} diff --git a/templates/series/single.html b/templates/series/single.html new file mode 100644 index 0000000..384c58d --- /dev/null +++ b/templates/series/single.html @@ -0,0 +1,23 @@ +{% extends "index.html" %} + +{% block title %}Posts in "{{ term.name }}"{% endblock title %} +{% block og_title %}Posts in "{{ term.name }}"{% endblock og_title %} +{% block twitter_title %}Posts in "{{ term.name }}"{% endblock twitter_title %} + +{% block meta_description %} + + + +{% endblock meta_description %} + +{% block content %} + {% block header %} + {{ super() }} + {% endblock header %} + +

{{ term.name }} - Series

+ + {% for page in term.pages %} + {{ post_macros::page_in_list(page=page) }} + {% endfor %} +{% endblock content %} diff --git a/zola.toml b/zola.toml index c026f51..a582cbd 100644 --- a/zola.toml +++ b/zola.toml @@ -13,6 +13,7 @@ taxonomies = [ # You can enable/disable RSS { name = "categories", feed = true }, { name = "tags", feed = true }, + { name = "series", feed = true }, ] author = "Leon" @@ -37,6 +38,7 @@ taxonomies = [ # You can enable/disable RSS { name = "categories", feed = true }, { name = "tags", feed = true }, + { name = "series", feed = true }, ] radion_title = "Leon's Personal Blog" @@ -44,6 +46,7 @@ radion_menu = [ { url = "$BASE_URL", name = "Home" }, { url = "$BASE_URL/categories", name = "Categories" }, { url = "$BASE_URL/tags", name = "Tags" }, + { url = "$BASE_URL/series", name = "Series" }, ] theme = "toggle" # options: {light, dark, auto, toggle} toc = true