mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
taxonomy: naming things #742
This commit is contained in:
parent
18061dbc06
commit
76782d06e5
3 changed files with 6 additions and 6 deletions
|
@ -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 "" }}
|
||||
|
|
|
@ -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" }}
|
||||
|
|
|
@ -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 }}
|
||||
|
|
Loading…
Reference in a new issue