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:
-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>