summaryrefslogtreecommitdiffstats
path: root/layouts/_partials/terms.html
blob: e693236a09198922bd878869b9b01a020224c889 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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 -}}