From 4ec5202d283147df1a85fed032d47afc88f07ac2 Mon Sep 17 00:00:00 2001 From: Quentin Duchemin Date: Tue, 25 May 2021 17:15:13 +0200 Subject: [PATCH] Fix pagination --- themes/chosto/layouts/_default/list.html | 6 ++++-- themes/chosto/layouts/partials/pagination.html | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/themes/chosto/layouts/_default/list.html b/themes/chosto/layouts/_default/list.html index a23a6e9..c333bd8 100644 --- a/themes/chosto/layouts/_default/list.html +++ b/themes/chosto/layouts/_default/list.html @@ -9,7 +9,9 @@ {{ end }}
- {{ range .Paginator.Pages }} + + {{ $paginator := .Paginate (where .Site.RegularPages "FirstSection.Section" "posts") }} + {{ range $paginator.Pages }} {{ if (eq .FirstSection.Section "posts")}}
{{ .Render "summary" }} @@ -17,7 +19,7 @@ {{ end }} {{ end }}
- {{- partial "pagination.html" . -}} + {{- partial "pagination.html" $paginator -}}
{{ end }} diff --git a/themes/chosto/layouts/partials/pagination.html b/themes/chosto/layouts/partials/pagination.html index 8f1455b..8f3ca51 100644 --- a/themes/chosto/layouts/partials/pagination.html +++ b/themes/chosto/layouts/partials/pagination.html @@ -1,4 +1,4 @@ -{{ $pag := $.Paginator }} +{{ $pag := . }} {{ if gt $pag.TotalPages 1 -}}