hugo-theme-relearn/layouts/_default/taxonomy.html
2023-05-19 09:54:14 +02:00

46 lines
No EOL
1.3 KiB
HTML

{{- partialCached "page-meta.hugo" . .RelPermalink }}
{{- partial "header.html" . }}
<article>
{{- $page := . }}
{{- $title := i18n .Data.Plural }}
{{- if not $title }}
{{- $title = .Data.Plural | humanize }}
{{- end }}
<h1 id="{{ $title | anchorize }}">{{ $title }}</h1>
<div class="tax-container">
{{- $lastCapital := "" }}
{{- range .Data.Terms.Alphabetical }}
{{- $capital := substr .Page.Title 0 1 | upper }}
{{- if ne $lastCapital $capital }}
{{- if ne $lastCapital "" }}
</ul>
</div>
{{- end }}
<div class="tax-box">
<h2 id="{{ $capital | anchorize }}">{{ $capital }}</h2>
<ul>
{{- end }}
{{- $c:=""}}{{/* display terms of a taxonomy */}}
{{- $len := 0 }}
{{- range .Pages }}
{{- $c:=""}}{{/* count pages of term */}}
{{- if and .Title (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) }}">{{ .Page.Title }}</a> ({{ $len }})</li>
{{- end }}
{{- $lastCapital = $capital }}
{{- end }}
{{- if ne $lastCapital "" }}
</ul>
</div>
{{- end }}
</div>
<footer class="footline">
</footer>
</article>
{{- partial "footer.html" . }}