From 8f0a341644fb0d9575b5429ca6193609a4d12d02 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Wed, 21 Jan 2026 17:34:37 -0500 Subject: tags --- layouts/_partials/terms.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 layouts/_partials/terms.html (limited to 'layouts/_partials/terms.html') diff --git a/layouts/_partials/terms.html b/layouts/_partials/terms.html new file mode 100644 index 0000000..afe3a14 --- /dev/null +++ b/layouts/_partials/terms.html @@ -0,0 +1,18 @@ +{{- /* +For a given taxonomy, renders a comma-separated list of terms assigned to the page. + +@context {string} taxonomy The taxonomy. +@context {page} page The current page. + +@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} +*/}} + +{{- $taxonomy := .taxonomy }} +{{- $page := .page }} + +{{- with $page.GetTerms $taxonomy -}} + {{- range $index, $term := . -}} + {{- if $index }}, {{ end -}} + {{ .LinkTitle }} + {{- end -}} +{{- end -}} -- cgit v1.2.3