mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-18 19:00:24 +00:00
taxonomy: display terms in pages if removePathAccents=true
#669
This commit is contained in:
parent
f1a58b8a8f
commit
3dfa5d718e
2 changed files with 8 additions and 9 deletions
|
@ -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 }}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue