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

github.com/xianmin/hugo-theme-jane.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author帅So_ <305784840@qq.com>2019-08-19 10:18:49 +0300
committerChen Xianmin <xianmin12@gmail.com>2019-08-19 10:18:49 +0300
commite61a7c6d6c344b10e16ca889aa26bab78e9dddb1 (patch)
tree0222e3650cb76acc32167128ddde78c90ffb03ab /layouts
parentdaeb4ac68c6f2fc21f3dc99c4a58e902499c36d8 (diff)
Fix: empty homepage or wrong posts list (#230)
caused by Hugo v.0.57.0
Diffstat (limited to 'layouts')
-rw-r--r--layouts/index.html23
1 files changed, 13 insertions, 10 deletions
diff --git a/layouts/index.html b/layouts/index.html
index d9b7127..1fdef27 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,13 +1,16 @@
{{ define "content" }}
- <section id="posts" class="posts">
- {{/* (index .Site.Paginate) */}}
- {{ $paginator := .Paginate (where .Data.Pages "Type" "post") }}
- {{ range $paginator.Pages }}
- {{ .Render "summary" }}
- {{ end }}
- </section>
+<section id="posts" class="posts">
+ {{ $pages := .Pages }}
+ {{ if .IsHome }}
+ {{ $pages = where .Site.RegularPages "Type" "in" site.Params.mainSections }}
+ {{ end }}
+ {{ $paginator := .Paginate $pages }}
+ {{ range $paginator.Pages }}
+ {{ .Render "summary" }}
+ {{ end }}
+</section>
- <!-- pagination -->
- {{ partial "pagination.html" . }}
+<!-- pagination -->
+{{ partial "pagination.html" . }}
-{{ end }} \ No newline at end of file
+{{ end }}