From f1dbc28426a61bd8a5c38e4b3ad11ec190071f8b Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Sun, 22 Oct 2023 20:23:00 +0100 Subject: Stream pagination now basically working with 10 items on each page --- config.toml | 2 +- layouts/stream/list.html | 47 +++++++++++++++++++++++++++++++++-------------- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/config.toml b/config.toml index 42e4ff3..d51482c 100644 --- a/config.toml +++ b/config.toml @@ -5,7 +5,7 @@ languageCode = "en-gb" enableInlineShortcodes = true pygmentsCodeFences = true pygmentsUseClasses = true -paginate = 2 +paginate = 10 [params] description = "An intentionally quiet and unassuming (and empty) blog" diff --git a/layouts/stream/list.html b/layouts/stream/list.html index 4b384d8..39c2b1e 100644 --- a/layouts/stream/list.html +++ b/layouts/stream/list.html @@ -2,26 +2,45 @@ {{ .Content }} -{{ range (.Paginate (where site.RegularPages "Section" "stream")).Pages }} +{{ $paginator := .Paginate (where site.RegularPages "Section" "stream") }} + +{{ range $paginator.Pages }} +

{{ .Date.Format "Monday, 2 January 2006" }}

- {{ .Content }} +{{ .Content }} - {{ if .Params.tags }} -
+{{ if .Params.tags }} +
This post is tagged with: - {{ range .Params.tags }} - {{ . }} - {{ end }} - {{ else }} + {{ range .Params.tags }} + {{ . }} + {{ end }} + {{ else }}
- This post is untagged. + This post is untagged.
- {{ end }} -
- permalink + {{ end }} +
+permalink + +
+{{ end }} + +

Stream navigation:

-
- {{ end }} +{{ if $paginator.HasPrev }} + +{{ end }} + + +{{ range $paginator.Pagers }} + {{ .PageNumber }} +{{ end }} + +{{ if $paginator.HasNext}} + +{{ end }} + {{ end }} -- cgit v1.2.3