diff options
Diffstat (limited to 'layouts/_partials/terms.html')
| -rw-r--r-- | layouts/_partials/terms.html | 18 |
1 files changed, 18 insertions, 0 deletions
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 -}} + <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a> + {{- end -}} +{{- end -}} |