From 15b344b58d2aaf23296307413ab182cf0a4109b6 Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Fri, 16 Aug 2019 13:27:41 -0500 Subject: use .RegularPages on home page: https://github.com/gohugoio/hugoThemes/issues/682 --- layouts/_default/list.html | 4 +++- layouts/partials/header.html | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 77457ad..395fd5b 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -2,7 +2,9 @@
-{{ $paginator := .Paginate (where .Data.Pages "Section" "!=" "") }} +{{ $pages := .Pages }} +{{ if .IsHome }}{{ $pages = .Site.RegularPages }}{{ end }} +{{ $paginator := .Paginate (where $pages "Section" "!=" "") }} {{ range $paginator.Pages }}
diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 7abbbf9..fbdb85e 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -32,7 +32,9 @@ {{ else }} {{ $.Scratch.Get "Title" }} {{ now.Format "2006-01-02" }} - {{ $paginator := .Paginate (where .Data.Pages "Section" "!=" "") }} + {{ $pages := .Pages }} + {{ if .IsHome }}{{ $pages = .Site.RegularPages }}{{ end }} + {{ $paginator := .Paginate (where $pages "Section" "!=" "") }} {{ with $paginator }}{{ if .TotalPages }}{{ .PageNumber }} / {{ .TotalPages }}{{ end }}{{ end }} {{ end }}
-- cgit v1.2.3