refactor: migrate to new template system introduced in Hugo v0.146.0 (#1232)
See: https://gohugo.io/templates/new-templatesystem-overview/
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
{{- $pages := "" -}}
|
||||
|
||||
{{- if .IsHome -}}
|
||||
{{ $pages = where .Site.RegularPages "Section" "in" .Site.Params.mainSections }}
|
||||
{{ $pages = where $pages "Params.hidden" "!=" true }}
|
||||
{{- else if eq .Kind "term" -}}
|
||||
{{ $pages = where .Pages "Params.hidden" "!=" true }}
|
||||
{{- else if or (eq .Kind "section") (eq .Kind "taxonomy") -}}
|
||||
{{ $subsections := .Sections }}
|
||||
{{ $pages = .Pages | complement $subsections }}
|
||||
{{ $pages = where $pages "Params.hidden" "!=" true }}
|
||||
|
||||
{{- if eq (len $pages) 0 -}}
|
||||
{{/* See complete logic in list.html */}}
|
||||
{{- $pages = $subsections -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $pages -}}
|
||||
{{ $pages = .Paginate $pages }}
|
||||
{{- end -}}
|
||||
|
||||
{{ return $pages }}
|
||||
Reference in New Issue
Block a user