fix: error when no page is found (#1234)
This commit is contained in:
@@ -1,10 +1,13 @@
|
|||||||
{{- $pages := "" -}}
|
{{- $pages := slice -}}
|
||||||
|
{{- $hasPages := false -}}
|
||||||
|
|
||||||
{{- 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 }}
|
||||||
|
{{- $hasPages = true -}}
|
||||||
{{- else if eq .Kind "term" -}}
|
{{- else if eq .Kind "term" -}}
|
||||||
{{ $pages = where .Pages "Params.hidden" "!=" true }}
|
{{ $pages = where .Pages "Params.hidden" "!=" true }}
|
||||||
|
{{- $hasPages = true -}}
|
||||||
{{- else if or (eq .Kind "section") (eq .Kind "taxonomy") -}}
|
{{- else if or (eq .Kind "section") (eq .Kind "taxonomy") -}}
|
||||||
{{ $subsections := .Sections }}
|
{{ $subsections := .Sections }}
|
||||||
{{ $pages = .Pages | complement $subsections }}
|
{{ $pages = .Pages | complement $subsections }}
|
||||||
@@ -14,9 +17,11 @@
|
|||||||
{{/* See complete logic in list.html */}}
|
{{/* See complete logic in list.html */}}
|
||||||
{{- $pages = $subsections -}}
|
{{- $pages = $subsections -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- $hasPages = true -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- if $pages -}}
|
{{- if $hasPages -}}
|
||||||
{{ $pages = .Paginate $pages }}
|
{{ $pages = .Paginate $pages }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user