mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
theme: compatiblity for taxonomy term lists with Hugo 0.123 #771
This commit is contained in:
parent
4bc5529bc8
commit
5fb02b2dd7
1 changed files with 12 additions and 6 deletions
|
@ -15,17 +15,23 @@
|
|||
{{- $terms := slice | append (index $page.Params $taxonomy) }}
|
||||
{{- $term_pages := slice }}
|
||||
{{- range $terms }}
|
||||
{{- $term := trim . " " }}
|
||||
{{- if not $term }}
|
||||
{{- continue }}
|
||||
{{- end }}
|
||||
{{- $term_key := ($term | plainify | anchorize) }}
|
||||
{{- $term := . }}
|
||||
{{- $term_key := $term }}
|
||||
{{- with $page.Site.GetPage (printf "%s/%s" $taxonomy $term_key) }}
|
||||
{{- $term_pages = $term_pages | append (dict "Title" (default (humanize .Data.Term | strings.Title) .Title) "Term" . )}}
|
||||
{{- else }}
|
||||
{{- $term_key = ($term | urlize) }}
|
||||
{{- $term = trim $term " " }}
|
||||
{{- if not $term }}
|
||||
{{- continue }}
|
||||
{{- end }}
|
||||
{{- $term_key = ($term | plainify | anchorize) }}
|
||||
{{- with $page.Site.GetPage (printf "%s/%s" $taxonomy $term_key) }}
|
||||
{{- $term_pages = $term_pages | append (dict "Title" (default (humanize .Data.Term | strings.Title) .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 (humanize .Data.Term | strings.Title) .Title) "Term" . )}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
Loading…
Reference in a new issue