hugo-theme-relearn/layouts/partials/_relearn/pagesTaxonomy.gotmpl

15 lines
642 B
Go Template
Raw Normal View History

{{- $pages := slice }}
{{- range .Data.Terms }}
2023-12-01 20:36:58 +00:00
{{- $count := 0 }}
{{- range .Pages }}
{{- /* count pages of term */}}
{{- if and .Title .RelPermalink (or (ne .Site.Params.disableTagHiddenPages true) (not (partialCached "_relearn/pageIsHiddenSelfOrAncestor.gotmpl" (dict "page" . "to" .Site.Home) .Path .Site.Home.Path) ) ) }}
2023-12-01 20:36:58 +00:00
{{- $count = add $count 1 }}
{{- end }}
{{- end }}
2023-12-01 20:36:58 +00:00
{{- if $count }}
{{- $pages = $pages| append (dict "Title" (partial "title.gotmpl" (dict "page" .Page "linkTitle" true)) "Page" .Page "Count" $count )}}
{{- end }}
{{- end }}
{{- $pages = sort $pages ".Title" }}
{{- return $pages }}