feat(paginate): add param home_paginate for home post pages and fix relURL bug

This commit is contained in:
Dillon
2019-11-20 21:39:04 +08:00
parent 789bd994ff
commit 473900da79
10 changed files with 24 additions and 16 deletions

View File

@@ -3,8 +3,14 @@
<div class="post-warp">
{{- partial "home/profile.html" . -}}
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "posts") -}}
{{ range where $paginator.Pages "Params.show_in_homepage" "!=" false -}}
{{ $paginator := where .Site.RegularPages "Type" "posts" -}}
{{ $paginator = where $paginator "Params.show_in_homepage" "!=" false -}}
{{ with .Site.Params.home_paginate -}}
{{ $paginator = $.Paginate $paginator . -}}
{{ else -}}
{{ $paginator = $.Paginate $paginator -}}
{{ end -}}
{{ range $paginator.Pages -}}
{{ .Render "summary" -}}
{{ end -}}