From 3dfa5d718ee69e917c5cda20d2d1593d319f2a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Tue, 3 Oct 2023 02:12:16 +0200 Subject: [PATCH] taxonomy: display terms in pages if `removePathAccents=true` #669 --- layouts/partials/content-footer.html | 8 ++++---- layouts/partials/tags.html | 9 ++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/layouts/partials/content-footer.html b/layouts/partials/content-footer.html index f3adbbce84..84a20d7551 100644 --- a/layouts/partials/content-footer.html +++ b/layouts/partials/content-footer.html @@ -7,11 +7,11 @@ {{- $page := . }} {{- if .Params.categories }} - {{- $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 }}{{ $category }} + {{ if gt $idx 0 }} | {{ end }}{{ $term }} {{- end }} {{- end }} {{- end }} diff --git a/layouts/partials/tags.html b/layouts/partials/tags.html index 8692267681..5eb004d719 100644 --- a/layouts/partials/tags.html +++ b/layouts/partials/tags.html @@ -2,12 +2,11 @@ {{- $page := . }} {{- if .Params.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 := . }} - {{ $tag }} + {{ $term }} {{- end }} {{- end }}