From f19c71fb6e680fde42a26731db23b2a2a97dde36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sapka?= Date: Sat, 21 Jan 2023 22:13:03 +0100 Subject: feat: pagination --- layouts/_default/baseof.html | 3 +++ layouts/_default/list.html | 11 +++++------ 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'layouts') diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index c9da4c0..c91cd5a 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -65,6 +65,9 @@ {{ end }} {{ block "main" . }} {{ end }} + + {{ block "pagination" . }} + {{ end }} {{ block "FOOTER" . }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index b709bd7..8ad2c03 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,17 +1,16 @@ {{ define "main" }} -{{- range where .Site.RegularPages "Params.category" "!=" "pages"}} +{{ $paginator := (.Paginator.Pages) }}. +{{ $paginator := .Paginate (where .Data.Pages "Type" "posts") }} +{{ range $paginator.Pages }}

{{ .Page.Title }}

({{ .PublishDate.Format "January 2nd, 2006" }})
- {{ .Page.Summary }} + {{ .Page.Content }}
- {{- if .Page.Truncated }} - More - - {{ end }}
{{ end }} + {{ template "_internal/pagination.html" . }} {{ end }} -- cgit v1.2.3