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.
22 lines
601 B
HTML
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 }}
|