diff options
author | Matthew Lemon <y@yulqen.org> | 2023-10-23 13:17:55 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2023-10-23 13:17:55 +0100 |
commit | 4bcbdbc1c2480128b6c992c46597c977c7d57797 (patch) | |
tree | 82b401aa30184fa1ee05b7651720f199230691ad /layouts/stream/list.html | |
parent | 4974bf7efe0a4428958679f6bdc7cc69dfc7291f (diff) |
wip: more on pagination - trying to understand .Scratch
Diffstat (limited to '')
-rw-r--r-- | layouts/stream/list.html | 17 |
1 files changed, 13 insertions, 4 deletions
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 }} <h3 id="{{ .Date.Format "Monday, 2 January 2006"| urlize}}">{{ .Date.Format "Monday, 2 January 2006" }}</h3> + +{{ $.Scratch.Set "toss" "toss" }} +<div style="margin-bottom: 1em;"> + {{ .Content }} +</div> + +{{ $.Scratch }} + {{ if $paginator.HasPrev }} <p>this page is paginated</p> + {{ $.Page.Scratch.Add "imgpath" "PAGINATED" }} {{ else }} <p>this page is NOT paginated</p> - {{ $.Scratch.Set "imgpath" "img/" }} + {{ $.Page.Scratch.Set "imgpath" "img/" }} {{ end }} -<div style="margin-bottom: 1em;"> - {{ .Content }} -</div> {{ if .Params.tags }} |