Make the name of the taxonomy copyable by putting it in the dom, rather than in the CSS content:.
22 lines
595 B
HTML
22 lines
595 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="taxonomy-list">
|
|
<span class="taxonomy-list__name">{{ $name }}</span>
|
|
<ul class="taxonomy-list__terms" data-name="{{ $name }}">
|
|
{{ range . }}<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>{{ end }}
|
|
</ul>
|
|
</div>
|
|
{{ end }}
|