Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/yihui/hugo-xmag.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYihui Xie <xie@yihui.name>2019-08-16 21:27:41 +0300
committerYihui Xie <xie@yihui.name>2019-08-16 21:27:41 +0300
commit15b344b58d2aaf23296307413ab182cf0a4109b6 (patch)
tree37c58886f2a997e899bfdcc3aa1028fec207ce40
parent26499570516666379466872b4d7d23eeb5bf94c4 (diff)
use .RegularPages on home page: https://github.com/gohugoio/hugoThemes/issues/682
-rw-r--r--layouts/_default/list.html4
-rw-r--r--layouts/partials/header.html4
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 @@
<div class="container">
<main class="list">
-{{ $paginator := .Paginate (where .Data.Pages "Section" "!=" "") }}
+{{ $pages := .Pages }}
+{{ if .IsHome }}{{ $pages = .Site.RegularPages }}{{ end }}
+{{ $paginator := .Paginate (where $pages "Section" "!=" "") }}
{{ range $paginator.Pages }}
<section class="article-list">
<div class="categories">
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 }}
<span>{{ $.Scratch.Get "Title" }}</span>
<span>{{ now.Format "2006-01-02" }}</span>
- {{ $paginator := .Paginate (where .Data.Pages "Section" "!=" "") }}
+ {{ $pages := .Pages }}
+ {{ if .IsHome }}{{ $pages = .Site.RegularPages }}{{ end }}
+ {{ $paginator := .Paginate (where $pages "Section" "!=" "") }}
<span>{{ with $paginator }}{{ if .TotalPages }}{{ .PageNumber }} / {{ .TotalPages }}{{ end }}{{ end }}</span>
{{ end }}
</div>