diff options
author | 帅So_ <305784840@qq.com> | 2019-08-19 10:18:49 +0300 |
---|---|---|
committer | Chen Xianmin <xianmin12@gmail.com> | 2019-08-19 10:18:49 +0300 |
commit | e61a7c6d6c344b10e16ca889aa26bab78e9dddb1 (patch) | |
tree | 0222e3650cb76acc32167128ddde78c90ffb03ab /layouts | |
parent | daeb4ac68c6f2fc21f3dc99c4a58e902499c36d8 (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.html | 23 |
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 }} |