diff options
author | ben <ben@nagy.contact> | 2025-06-28 11:20:24 -0700 |
---|---|---|
committer | ben <ben@nagy.contact> | 2025-06-28 11:20:24 -0700 |
commit | a1ebb1c85ae6d749170ce4e9b18f0bdec92d27e8 (patch) | |
tree | 9983326f35a9186d82866a16ed230a5ccfbbfa11 /layouts/_partials/terms.html | |
parent | 648de6962e963cd4147fa849f38d023c16a1ff49 (diff) |
bare
Diffstat (limited to 'layouts/_partials/terms.html')
-rw-r--r-- | layouts/_partials/terms.html | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/layouts/_partials/terms.html b/layouts/_partials/terms.html new file mode 100644 index 0000000..8a6ebec --- /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 taxonomy. + +@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} +*/}} + +{{- $page := .page }} +{{- $taxonomy := .taxonomy }} + +{{- with $page.GetTerms $taxonomy }} + {{- $label := (index . 0).Parent.LinkTitle }} + <div> + <div>{{ $label }}:</div> + <ul> + {{- range . }} + <li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li> + {{- end }} + </ul> + </div> +{{- end }} |