e176e29811
It's recommended by Hugo's official doc: https://gohugo.io/functions/where/#mainsections
16 lines
706 B
HTML
16 lines
706 B
HTML
{{- $title := .Title -}}
|
|
{{- $siteTitle := .Site.Title -}}
|
|
{{- $authorName := .Site.Author.name -}}
|
|
|
|
{{- if .IsHome -}}
|
|
{{ $pages := where .Site.RegularPages "Section" "in" .Site.Params.mainSections }}
|
|
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }}
|
|
{{ $filtered := ($pages | intersect $notHidden) }}
|
|
{{ $pag := .Paginate ($filtered) }}
|
|
{{ if .Paginator.HasPrev }}{{ .Paginator }} - {{ end }}{{ $siteTitle }}
|
|
{{- else if eq .Kind "term" -}}
|
|
{{- $pag := .Paginate (where .Data.Pages "Type" "post") -}}
|
|
{{ title .Data.Singular }}: {{ $title }}{{ if .Paginator.HasPrev }} - {{ .Paginator }}{{ end }} - {{ $siteTitle }}
|
|
{{- else -}}
|
|
{{- $title -}}
|
|
{{- end -}} |