From 5e5706b55de6ef107bcd31a9960fb438c77d958f Mon Sep 17 00:00:00 2001 From: Emil Miler Date: Tue, 9 Jan 2024 23:20:06 +0100 Subject: [PATCH] Enable macros for nav item listing --- config.toml | 6 ++++++ templates/base.html | 5 ++--- templates/macros.html | 9 +++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 templates/macros.html diff --git a/config.toml b/config.toml index ebca43d..a1b019c 100644 --- a/config.toml +++ b/config.toml @@ -12,3 +12,9 @@ external_links_no_follow = true external_links_no_referrer = true [extra] +nav = [ + {title = "Informace", path = "/informace/"}, + {title = "Personál", path = "/personal/"}, + {title = "Kontakt", path = "/kontakt/"}, + {title = "Přihlášky", path = "https://prihlasky.kocandaci.cz", external = true} +] diff --git a/templates/base.html b/templates/base.html index 6270c4b..a11bc9a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,3 +1,4 @@ +{% import "macros.html" as macros %} @@ -12,9 +13,7 @@
diff --git a/templates/macros.html b/templates/macros.html new file mode 100644 index 0000000..af92664 --- /dev/null +++ b/templates/macros.html @@ -0,0 +1,9 @@ +{% macro nav_items() %} +{% for item in config.extra.nav %} + {% if item.external %} +
  • {{ item.title }}
  • + {% else %} +
  • {{ item.title }}
  • + {% endif %} +{% endfor %} +{% endmacro %}