From e0ca8f1f2c58245484f72711334161795b1c8867 Mon Sep 17 00:00:00 2001 From: Emil Miler Date: Fri, 3 Dec 2021 22:59:23 +0100 Subject: [PATCH] Enable taxonomies and list them in navigation --- config.toml | 4 ++++ templates/categories/list.html | 1 + templates/categories/single.html | 1 + templates/index.html | 7 +------ templates/macros.html | 10 ++++++++++ 5 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 templates/categories/list.html create mode 100644 templates/categories/single.html diff --git a/config.toml b/config.toml index 59b1283..e42d998 100644 --- a/config.toml +++ b/config.toml @@ -3,6 +3,10 @@ title = "em.0x45.cz" compile_sass = true build_search_index = false +taxonomies = [ + {name = "categories", feed = false} +] + [markdown] highlight_code = true smart_punctuation = true diff --git a/templates/categories/list.html b/templates/categories/list.html new file mode 100644 index 0000000..09763b9 --- /dev/null +++ b/templates/categories/list.html @@ -0,0 +1 @@ +{% extends "index.html" %} diff --git a/templates/categories/single.html b/templates/categories/single.html new file mode 100644 index 0000000..09763b9 --- /dev/null +++ b/templates/categories/single.html @@ -0,0 +1 @@ +{% extends "index.html" %} diff --git a/templates/index.html b/templates/index.html index 3860049..db47b81 100644 --- a/templates/index.html +++ b/templates/index.html @@ -16,12 +16,7 @@
  • {{ item.title }}
  • {% endfor %} - Title - + {{ macros::list_taxonomy(title="Categories", kind="categories") }}
    {% block content %} diff --git a/templates/macros.html b/templates/macros.html index 7561f2f..d4adf9f 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -26,3 +26,13 @@ {% endif %} {% endmacro %} + +{% macro list_taxonomy(title, kind) %} + {{ title }} + +{% endmacro list_categories %}