From: Kai Moritz Date: Fri, 28 Nov 2025 13:19:31 +0000 (+0100) Subject: WIP:thymeleaf:taxonomies-on-page X-Git-Tag: hugo--mein-erstes-partial~34 X-Git-Url: https://juplo.de/gitweb/?a=commitdiff_plain;h=2bf42846e6e7034a15e9b75d7d4fb732d7b89556;p=website WIP:thymeleaf:taxonomies-on-page --- diff --git a/hugo/themes/thymeleaf/layouts/_partials/terms.html b/hugo/themes/thymeleaf/layouts/_partials/terms.html index 35df26d5..cf4d669b 100644 --- a/hugo/themes/thymeleaf/layouts/_partials/terms.html +++ b/hugo/themes/thymeleaf/layouts/_partials/terms.html @@ -1,3 +1,39 @@ +{{- /* +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 }}:
+ +
+{{- end }} + + {{- define "custom_css" }} {{- end }} -{{- define "main" }} - -{{- if .Title }} - -{{- end }} - - - -{{- end }}{{/* end main */ -}}