taxonomy: naming things #742

This commit is contained in:
Sören Weber 2023-12-01 21:36:58 +01:00
parent 18061dbc06
commit 76782d06e5
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
3 changed files with 6 additions and 6 deletions

View file

@ -20,7 +20,7 @@
<ul class="columnize"> <ul class="columnize">
{{- end }} {{- end }}
{{- $c:=""}}{{/* display terms of a taxonomy */}} {{- $c:=""}}{{/* display terms of a taxonomy */}}
<li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Page.Page) }}">{{ .Title }}</a> ({{ .Len }})</li> <li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Page) }}">{{ .Title }}</a> ({{ .Count }})</li>
{{- $lastCapital = $capital }} {{- $lastCapital = $capital }}
{{- end }} {{- end }}
{{- if ne $lastCapital "" }} {{- if ne $lastCapital "" }}

View file

@ -1,14 +1,14 @@
{{- $pages := slice }} {{- $pages := slice }}
{{- range .Data.Terms }} {{- range .Data.Terms }}
{{- $len := 0 }} {{- $count := 0 }}
{{- range .Pages }} {{- range .Pages }}
{{- $c:=""}}{{/* count pages of term */}} {{- $c:=""}}{{/* count pages of term */}}
{{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }} {{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }}
{{- $len = add $len 1 }} {{- $count = add $count 1 }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if $len }} {{- if $count }}
{{- $pages = $pages| append (dict "Title" (default (humanize .Page.Data.Term | strings.Title) .Page.Title) "Page" . "Len" $len )}} {{- $pages = $pages| append (dict "Title" (default (humanize .Page.Data.Term | strings.Title) .Page.Title) "Page" .Page "Count" $count )}}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- $pages = sort $pages ".Title" }} {{- $pages = sort $pages ".Title" }}

View file

@ -14,7 +14,7 @@
{{- if eq .Page.Kind "taxonomy" }} {{- if eq .Page.Kind "taxonomy" }}
{{- /* go to first term page */}} {{- /* go to first term page */}}
{{- $pages := partialCached "partials/pageHelper/taxonomyPages.html" . . }} {{- $pages := partialCached "partials/pageHelper/taxonomyPages.html" . . }}
{{- $next = (index $pages 0).Page.Page }} {{- $next = (index $pages 0).Page }}
{{- else if eq .Page.Kind "term" }} {{- else if eq .Page.Kind "term" }}
{{- /* go to next term page */}} {{- /* go to next term page */}}
{{- $taxonomy_page := .Site.GetPage .Data.Plural }} {{- $taxonomy_page := .Site.GetPage .Data.Plural }}