From 4bcbdbc1c2480128b6c992c46597c977c7d57797 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 23 Oct 2023 13:17:55 +0100 Subject: wip: more on pagination - trying to understand .Scratch --- layouts/stream/list.html | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'layouts/stream') diff --git a/layouts/stream/list.html b/layouts/stream/list.html index 127d2eb..2fb46b4 100644 --- a/layouts/stream/list.html +++ b/layouts/stream/list.html @@ -1,23 +1,32 @@ {{ define "main" }} + {{ .Content }} + {{ $paginator := .Paginate (where site.RegularPages "Section" "stream") }} + {{ range $paginator.Pages }}

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

+ +{{ $.Scratch.Set "toss" "toss" }} +
+ {{ .Content }} +
+ +{{ $.Scratch }} + {{ if $paginator.HasPrev }}

this page is paginated

+ {{ $.Page.Scratch.Add "imgpath" "PAGINATED" }} {{ else }}

this page is NOT paginated

- {{ $.Scratch.Set "imgpath" "img/" }} + {{ $.Page.Scratch.Set "imgpath" "img/" }} {{ end }} -
- {{ .Content }} -
{{ if .Params.tags }} -- cgit v1.2.3