From cd0279d2787bbf265e12e309b8a61489c727bb2a Mon Sep 17 00:00:00 2001 From: Brandon Date: Sat, 26 Oct 2024 19:51:38 -0400 Subject: create repo --- layouts/partials/terms.html | 23 +++++++++++++++++++++++ 1 file changed, 23 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..47cf6e4 --- /dev/null +++ b/layouts/partials/terms.html @@ -0,0 +1,23 @@ +{{- /* +For a given taxonomy, renders a list of terms assigned to the page. + +@context {page} page The current page. +@context {string} taxonomy The taxonony. + +@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} +*/}} + +{{- $page := .page }} +{{- $taxonomy := .taxonomy }} + +{{- with $page.GetTerms $taxonomy }} + {{- $label := (index . 0).Parent.LinkTitle }} +
+
{{ $label }}:
+ +
+{{- end }} -- cgit v1.2.3