fix: error when no page is available in the current list (#1263)
This commit is contained in:
@@ -1,11 +1,9 @@
|
|||||||
{{- $pages := "" -}}
|
{{- $pages := slice -}}
|
||||||
|
|
||||||
{{- if .IsHome -}}
|
{{- if .IsHome -}}
|
||||||
{{ $pages = where .Site.RegularPages "Section" "in" .Site.Params.mainSections }}
|
{{ $pages = where .Site.RegularPages "Section" "in" .Site.Params.mainSections }}
|
||||||
{{ $pages = where $pages "Params.hidden" "!=" true }}
|
{{ $pages = where $pages "Params.hidden" "!=" true }}
|
||||||
{{- else if eq .Kind "term" -}}
|
{{- else if or (eq .Kind "section") (eq .Kind "taxonomy") (eq .Kind "term") -}}
|
||||||
{{ $pages = where .Pages "Params.hidden" "!=" true }}
|
|
||||||
{{- else if or (eq .Kind "section") (eq .Kind "taxonomy") -}}
|
|
||||||
{{ $subsections := .Sections }}
|
{{ $subsections := .Sections }}
|
||||||
{{ $pages = .Pages | complement $subsections }}
|
{{ $pages = .Pages | complement $subsections }}
|
||||||
{{ $pages = where $pages "Params.hidden" "!=" true }}
|
{{ $pages = where $pages "Params.hidden" "!=" true }}
|
||||||
@@ -16,7 +14,7 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- if $pages -}}
|
{{- if or .IsHome (eq .Kind "section") (eq .Kind "taxonomy") (eq .Kind "term") -}}
|
||||||
{{ $pages = .Paginate $pages }}
|
{{ $pages = .Paginate $pages }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user