From: Kai Moritz Date: Sat, 22 Nov 2025 15:12:02 +0000 (+0100) Subject: WIP:refactor: display terms as term/number-buttons X-Git-Tag: wip--hugo--rebase--2025-11-29--09-32~3 X-Git-Url: https://juplo.de/gitweb/?a=commitdiff_plain;h=8191832712c041e7939d50f79f02371742d2607d;p=website WIP:refactor: display terms as term/number-buttons --- 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 */ -}}