mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
26 lines
888 B
HTML
26 lines
888 B
HTML
|
{{- $taxonomy := .taxonomy }}
|
||
|
{{- if eq "string" (printf "%T" $taxonomy) }}
|
||
|
{{- $taxonomy = .page.GetPage $taxonomy }}
|
||
|
{{- end }}
|
||
|
{{- $headingstyle := .headingstyle | default "h2" }}
|
||
|
{{- with $taxonomy }}
|
||
|
{{- .Content }}
|
||
|
{{- $lastCapital := "" }}
|
||
|
{{- $pages := partialCached "partials/_relearn/pagesTaxonomy.gotmpl" . .Path }}
|
||
|
{{- range $pages }}
|
||
|
{{- $capital := substr .Title 0 1 | upper }}
|
||
|
{{- if ne $lastCapital $capital }}
|
||
|
{{- if ne $lastCapital "" }}
|
||
|
</ul>
|
||
|
{{- end }}
|
||
|
{{ (printf `<%s id="%s">%s</%s>` $headingstyle ($capital | plainify | anchorize) $capital $headingstyle) | safeHTML }}
|
||
|
<ul class="columnize">
|
||
|
{{- end }}
|
||
|
{{- /* display terms of a taxonomy */}}
|
||
|
<li><a href="{{ partial "permalink.gotmpl" (dict "to" .Page) }}">{{ .Title }}</a> ({{ .Count }})</li>
|
||
|
{{- $lastCapital = $capital }}
|
||
|
{{- end }}
|
||
|
{{- if ne $lastCapital "" }}
|
||
|
</ul>
|
||
|
{{- end }}
|
||
|
{{- end }}
|