hugo-theme-termlite/layouts/partials/page/taxonomy_list.html
2024-11-24 10:19:26 -08:00

24 lines
617 B
HTML

{{- /*
Generates a list of the terms for a given taxonomy.
@context {Page} .page The current page
@context {String} .taxonomy The name of the taxonomy
*/ -}}
{{- $taxonomy := .taxonomy -}}
{{ with .page.GetTerms $taxonomy }}
{{- $name := $taxonomy -}}
{{- with T $taxonomy (len .) }}
{{ $name = . }}
{{ end -}}
<div class="tag">
<span class="tag__name">{{ $name }}</span>
<ul class="tag__value--list" data-name="{{ $name }}">
{{ range . -}}
<li class="tag__list-item"><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{- end -}}
</ul>
</div>
{{ end }}