diff --git a/layouts/partials/term-list.html b/layouts/partials/term-list.html index 4402ca35e5..ca32835fa2 100644 --- a/layouts/partials/term-list.html +++ b/layouts/partials/term-list.html @@ -13,19 +13,20 @@ {{- end }} {{- $taxonomy_page := $page.Site.GetPage $taxonomy }} {{- $terms := slice | append (index $page.Params $taxonomy) }} -{{- $term_pages := dict }} -{{- range sort $terms }} +{{- $term_pages := slice }} +{{- range $terms }} {{- $term := trim . " " }} {{- if not $term }} {{- continue }} {{- end }} {{- $term_key := ($term | plainify | anchorize) }} {{- with $page.Site.GetPage (printf "%s/%s" $taxonomy $term_key) }} - {{- $term_pages = $term_pages | merge (dict $term_key .) }} - {{- end }} - {{- $term_key = ($term | urlize) }} - {{- with $page.Site.GetPage (printf "%s/%s" $taxonomy $term_key) }} - {{- $term_pages = $term_pages | merge (dict $term_key .) }} + {{- $term_pages = $term_pages | append (dict "Title" (default .Data.Term .Title) "Term" . )}} + {{- else }} + {{- $term_key = ($term | urlize) }} + {{- with $page.Site.GetPage (printf "%s/%s" $taxonomy $term_key) }} + {{- $term_pages = $term_pages | append (dict "Title" (default .Data.Term .Title) "Term" . )}} + {{- end }} {{- end }} {{- end }} {{- with $term_pages }} @@ -34,9 +35,9 @@ {{- end }}