From: Kai Moritz Date: Sun, 30 Nov 2025 08:11:06 +0000 (+0100) Subject: thymeleaf-theme: Reworked partial `terms.html` X-Git-Tag: hugo--rebase--2025-12-03~1 X-Git-Url: https://juplo.de/gitweb/?a=commitdiff_plain;h=d5fb1a903186287b0f0835789a85f6c2824f2518;p=website thymeleaf-theme: Reworked partial `terms.html` --- 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 }}