From d5fb1a903186287b0f0835789a85f6c2824f2518 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 30 Nov 2025 09:11:06 +0100 Subject: [PATCH] thymeleaf-theme: Reworked partial `terms.html` --- .../thymeleaf/layouts/_partials/terms.html | 34 +++++++------------ hugo/themes/thymeleaf/layouts/page.html | 2 +- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/hugo/themes/thymeleaf/layouts/_partials/terms.html b/hugo/themes/thymeleaf/layouts/_partials/terms.html index 8a6ebec2..550ed41a 100644 --- a/hugo/themes/thymeleaf/layouts/_partials/terms.html +++ b/hugo/themes/thymeleaf/layouts/_partials/terms.html @@ -1,23 +1,13 @@ -{{- /* -For a given taxonomy, renders a list of terms assigned to the page. - -@context {page} page The current page. -@context {string} taxonomy The taxonomy. - -@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} -*/}} - -{{- $page := .page }} -{{- $taxonomy := .taxonomy }} - -{{- with $page.GetTerms $taxonomy }} - {{- $label := (index . 0).Parent.LinkTitle }} -
-
{{ $label }}:
- -
+{{- $page := .Page }} +{{- range .Page.Site.Taxonomies }} +{{- $taxonomy := . }} +{{- $terms := $page.GetTerms .Page.Data.Plural }} +{{- if gt $terms.Len 0 }} +

{{ .Page.LinkTitle }}

+ +{{- end }} {{- end }} diff --git a/hugo/themes/thymeleaf/layouts/page.html b/hugo/themes/thymeleaf/layouts/page.html index 7e286c80..1f53ceb9 100644 --- a/hugo/themes/thymeleaf/layouts/page.html +++ b/hugo/themes/thymeleaf/layouts/page.html @@ -6,5 +6,5 @@ {{ .Content }} - {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} + {{ partial "terms.html" . }} {{ end }} -- 2.39.5