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">
{{- end }}
{{- $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 }}
{{- end }}
{{- if ne $lastCapital "" }}

View file

@ -1,14 +1,14 @@
{{- $pages := slice }}
{{- range .Data.Terms }}
{{- $len := 0 }}
{{- $count := 0 }}
{{- range .Pages }}
{{- $c:=""}}{{/* count pages of term */}}
{{- 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 }}
{{- if $len }}
{{- $pages = $pages| append (dict "Title" (default (humanize .Page.Data.Term | strings.Title) .Page.Title) "Page" . "Len" $len )}}
{{- if $count }}
{{- $pages = $pages| append (dict "Title" (default (humanize .Page.Data.Term | strings.Title) .Page.Title) "Page" .Page "Count" $count )}}
{{- end }}
{{- end }}
{{- $pages = sort $pages ".Title" }}

View file

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