hugo-theme-termlite/layouts/partials/page/taxonomy_list.html

19 lines
482 B
HTML

{{/*
Generates a list of the terms for a given taxonomy.
@param {Page} .page The current page
@param {String} .taxonomy The name of the taxonomy
*/}}
{{- $taxonomy := .taxonomy -}}
{{ with .page.GetTerms $taxonomy }}
{{- $name := $taxonomy -}}
{{- with T $taxonomy (len .) }}
{{ $name = . }}
{{ end -}}
<ul class="taxonomy-list" data-name="{{ $name }}">
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
{{ end }}