Files
hugo-theme-stack/layouts/_partials/helper/paginator.html
T

27 lines
697 B
HTML
Raw Normal View History

2026-01-25 23:12:28 +01:00
{{- $pages := slice -}}
{{- $hasPages := false -}}
{{- if .IsHome -}}
{{ $pages = where .Site.RegularPages "Section" "in" .Site.Params.mainSections }}
2026-01-25 23:12:28 +01:00
{{- $hasPages = true -}}
{{- else if eq .Kind "term" -}}
{{ $pages = .Pages }}
2026-01-25 23:12:28 +01:00
{{- $hasPages = true -}}
{{- else if or (eq .Kind "section") (eq .Kind "taxonomy") -}}
{{ $subsections := .Sections }}
{{ $pages = .Pages | complement $subsections }}
{{- if eq (len $pages) 0 -}}
{{/* See complete logic in list.html */}}
{{- $pages = $subsections -}}
{{- end -}}
2026-01-25 23:12:28 +01:00
{{- $hasPages = true -}}
{{- end -}}
2026-01-25 23:12:28 +01:00
{{- if $hasPages -}}
{{ $pages = .Paginate $pages }}
{{- end -}}
{{ return $pages }}