From 0d6c92124e6e21a536de6711ab5f82fa88200194 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 2 Dec 2024 17:20:09 -0800 Subject: basic setup for tags --- templates/index.html | 6 ++++++ templates/page.html | 8 ++++++++ templates/tags/list.html | 12 ++++++++++++ templates/tags/single.html | 12 ++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 templates/tags/list.html create mode 100644 templates/tags/single.html (limited to 'templates') diff --git a/templates/index.html b/templates/index.html index 9c8f98d..f1a8cbe 100644 --- a/templates/index.html +++ b/templates/index.html @@ -6,4 +6,10 @@ {{ section.content | safe }} {% endif %} +

Tags

+{% set blogtags = get_taxonomy(kind="tags") %} +{% for tag in blogtags.items %} +#{{ tag.name }} +{% endfor %} + {%- endblock content -%} diff --git a/templates/page.html b/templates/page.html index ab19904..3474a07 100644 --- a/templates/page.html +++ b/templates/page.html @@ -5,6 +5,14 @@ {% block content -%}

{{ page.title }}

+{% if page.taxonomies.tags %} +
+ {% for tag in page.taxonomies.tags %} + #{{ tag }} + {% endfor %} +
+{% endif %} + {{ page.content | safe -}}

{{ page.date | date(format="%B %d, %Y") }}

diff --git a/templates/tags/list.html b/templates/tags/list.html new file mode 100644 index 0000000..b7f904a --- /dev/null +++ b/templates/tags/list.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} + +{% block content %} +

Tags

+ +{% endblock content %} diff --git a/templates/tags/single.html b/templates/tags/single.html new file mode 100644 index 0000000..b276f93 --- /dev/null +++ b/templates/tags/single.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} + +{% block content %} +

Tag: {{ term.name }}

+ +{% endblock content %} -- cgit v1.2.3