From 8191832712c041e7939d50f79f02371742d2607d Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 22 Nov 2025 16:12:02 +0100 Subject: [PATCH] WIP:refactor: display terms as term/number-buttons --- .../thymeleaf/layouts/_partials/terms.html | 44 ++++++++------- hugo/themes/thymeleaf/layouts/baseof.html | 1 + hugo/themes/thymeleaf/layouts/taxonomy.html | 56 ++++++++++++++++--- hugo/themes/thymeleaf/layouts/terms.html | 49 ++++++++++++++++ 4 files changed, 123 insertions(+), 27 deletions(-) create mode 100644 hugo/themes/thymeleaf/layouts/terms.html diff --git a/hugo/themes/thymeleaf/layouts/_partials/terms.html b/hugo/themes/thymeleaf/layouts/_partials/terms.html index 8a6ebec2..6fd26540 100644 --- a/hugo/themes/thymeleaf/layouts/_partials/terms.html +++ b/hugo/themes/thymeleaf/layouts/_partials/terms.html @@ -1,23 +1,27 @@ -{{- /* -For a given taxonomy, renders a list of terms assigned to the page. +{{- define "main" }} -@context {page} page The current page. -@context {string} taxonomy The taxonomy. - -@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} -*/}} +{{- if .Title }} + +{{- end }} -{{- $page := .page }} -{{- $taxonomy := .taxonomy }} + -{{- with $page.GetTerms $taxonomy }} - {{- $label := (index . 0).Parent.LinkTitle }} -
-
{{ $label }}:
- -
-{{- end }} +{{- end }}{{/* end main */ -}} diff --git a/hugo/themes/thymeleaf/layouts/baseof.html b/hugo/themes/thymeleaf/layouts/baseof.html index 5ed59902..5401b84c 100644 --- a/hugo/themes/thymeleaf/layouts/baseof.html +++ b/hugo/themes/thymeleaf/layouts/baseof.html @@ -2,6 +2,7 @@ {{ partial "head.html" . }} + {{ block "custom_css" . }}{{ end }}
diff --git a/hugo/themes/thymeleaf/layouts/taxonomy.html b/hugo/themes/thymeleaf/layouts/taxonomy.html index c2e78751..35df26d5 100644 --- a/hugo/themes/thymeleaf/layouts/taxonomy.html +++ b/hugo/themes/thymeleaf/layouts/taxonomy.html @@ -1,7 +1,49 @@ -{{ define "main" }} -

{{ .Title }}

- {{ .Content }} - {{ range .Pages }} -

{{ .LinkTitle }}

- {{ end }} -{{ end }} +{{- define "custom_css" }} + +{{- end }} +{{- define "main" }} + +{{- if .Title }} + +{{- end }} + + + +{{- end }}{{/* end main */ -}} diff --git a/hugo/themes/thymeleaf/layouts/terms.html b/hugo/themes/thymeleaf/layouts/terms.html new file mode 100644 index 00000000..35df26d5 --- /dev/null +++ b/hugo/themes/thymeleaf/layouts/terms.html @@ -0,0 +1,49 @@ +{{- define "custom_css" }} + +{{- end }} +{{- define "main" }} + +{{- if .Title }} + +{{- end }} + + + +{{- end }}{{/* end main */ -}} -- 2.39.5