hugo-theme-termlite/layouts/partials/page/taxonomy_list.html
Eryn Wells edd6eb996b A more generic tag/value component
Write styles and templates for a more generic tag/value component. Use this component
for the taxonomy lists, draft tag, and page dates in the summary template.
2024-10-12 10:45:52 -07:00

22 lines
601 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__value__list-item"><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>{{ end }}
</ul>
</div>
{{ end }}