taxonomy: display terms in pages if removePathAccents=true #669

This commit is contained in:
Sören Weber 2023-10-03 02:12:16 +02:00
parent f1a58b8a8f
commit 3dfa5d718e
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
2 changed files with 8 additions and 9 deletions

View file

@ -7,11 +7,11 @@
{{- $page := . }}
{{- if .Params.categories }}
<i class='fas fa-list'></i>
{{- $categories := slice | append .Params.categories }}
{{- range $idx, $category := sort $categories }}
{{- with $page.Site.GetPage (printf "%s%s" ("/categories/" | relURL ) ( $category | plainify | anchorize ) ) }}
{{- $terms := slice | append .Params.categories }}
{{- range $idx, $term := sort $terms }}
{{- with ($page.Site.GetPage (printf "%s%s" ("/categories/" | relURL) ($term | plainify | anchorize)) | default ($page.Site.GetPage (printf "%s%s" ("/categories/" | relURL) ($term | urlize)))) }}
{{- $to := . }}
{{ if gt $idx 0 }} | {{ end }}<a class="tag-link" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" $to) }}">{{ $category }}</a>
{{ if gt $idx 0 }} | {{ end }}<a class="tag-link" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" $to) }}">{{ $term }}</a>
{{- end }}
{{- end }}
{{- end }}

View file

@ -2,12 +2,11 @@
{{- $page := . }}
{{- if .Params.tags }}
<div class="tags">
{{- $tags := slice | append .Params.tags }}
{{- range sort $tags }}
{{- $tag := . }}
{{- with $page.Site.GetPage (printf "%s%s" ("/tags/" | relURL ) ( $tag | plainify | anchorize ) ) }}
{{- $terms := slice | append .Params.tags }}
{{- range $term := sort $terms }}
{{- with ($page.Site.GetPage (printf "%s%s" ("/tags/" | relURL) ($term | plainify | anchorize)) | default ($page.Site.GetPage (printf "%s%s" ("/tags/" | relURL) ($term | urlize)))) }}
{{- $to := . }}
<a class="tag-link" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" $to) }}">{{ $tag }}</a>
<a class="tag-link" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" $to) }}">{{ $term }}</a>
{{- end }}
{{- end }}
</div>