taxonomy: avoid sorting issues on renamed terms #701

This commit is contained in:
Sören Weber 2023-10-29 00:17:25 +02:00
parent 524d377ca2
commit d64b8b62cd
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D

View file

@ -12,7 +12,7 @@
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1> <h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
{{- $lastCapital := "" }} {{- $lastCapital := "" }}
{{- range .Data.Terms.Alphabetical }} {{- range .Data.Terms.Alphabetical }}
{{- $capital := substr (default .Page.Data.Term .Page.Title) 0 1 | upper }} {{- $capital := substr .Page.Data.Term 0 1 | upper }}
{{- if ne $lastCapital $capital }} {{- if ne $lastCapital $capital }}
{{- if ne $lastCapital "" }} {{- if ne $lastCapital "" }}
</ul> </ul>
@ -29,7 +29,7 @@
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if $len }} {{- if $len }}
<li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Page) }}">{{ (default .Page.Data.Term .Page.Title) }}</a> ({{ $len }})</li> <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 }} {{- end }}
{{- $lastCapital = $capital }} {{- $lastCapital = $capital }}
{{- end }} {{- end }}