hugo-theme-relearn/layouts/_default/taxonomy.html

43 lines
1.4 KiB
HTML
Raw Normal View History

{{- partialCached "page-meta.hugo" . .RelPermalink }}
{{- partial "header.html" . }}
<article>
<header class="headline">
</header>
{{- $page := . }}
{{- $title := i18n .Data.Plural }}
{{- if not $title }}
2023-06-18 09:13:33 +00:00
{{- $title = .Data.Plural }}
{{- end }}
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
{{- $lastCapital := "" }}
{{- range .Data.Terms.Alphabetical }}
{{- $capital := substr .Page.Data.Term 0 1 | upper }}
{{- if ne $lastCapital $capital }}
{{- if ne $lastCapital "" }}
</ul>
{{- end }}
<h2 id="{{ $capital | plainify | anchorize }}">{{ $capital }}</h2>
<ul class="columnize">
{{- end }}
{{- $c:=""}}{{/* display terms of a taxonomy */}}
{{- $len := 0 }}
{{- range .Pages }}
{{- $c:=""}}{{/* count pages of term */}}
{{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }}
{{- $len = add $len 1 }}
{{- end }}
{{- end }}
{{- if $len }}
<li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Page) }}">{{ (default .Page.Data.Term .Page.Title) }}{{ if and .Page.Title (ne .Page.Data.Term .Page.Title) }} ({{ .Page.Data.Term }}){{ end }}</a> ({{ $len }})</li>
{{- end }}
{{- $lastCapital = $capital }}
{{- end }}
{{- if ne $lastCapital "" }}
</ul>
{{- end }}
<footer class="footline">
</footer>
</article>
{{- partial "footer.html" . }}