From: Kai Moritz Date: Sun, 30 Nov 2025 08:11:06 +0000 (+0100) Subject: thymeleaf-theme: Reworked partial `terms.html` X-Git-Url: https://juplo.de/gitweb/?a=commitdiff_plain;h=9eed68dc06ba8557433b40e7cd08cdf65c61a570;p=website thymeleaf-theme: Reworked partial `terms.html` --- diff --git a/layouts/_partials/terms.html b/layouts/_partials/terms.html index 8a6ebec2..550ed41a 100644 --- a/layouts/_partials/terms.html +++ b/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/layouts/page.html b/layouts/page.html index 30fcf482..53a78e07 100644 --- a/layouts/page.html +++ b/layouts/page.html @@ -4,5 +4,5 @@ {{ .Content }} - {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} + {{ partial "terms.html" . }} {{ end }}