mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-24 10:51:47 +01:00
e176e29811
It's recommended by Hugo's official doc: https://gohugo.io/functions/where/#mainsections
16 lines
No EOL
706 B
HTML
16 lines
No EOL
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 -}} |