summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorMichał Sapka <michal@sapka.me>2023-01-21 22:13:03 +0100
committerMichał Sapka <michal@sapka.me>2023-01-21 22:13:16 +0100
commitf19c71fb6e680fde42a26731db23b2a2a97dde36 (patch)
tree0ec11c5796be405b8e158c9d2835fcfcb1947473 /layouts
parent0d6a8eaca5f79b81fe8eada050aeb0ac960b9774 (diff)
feat: pagination
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/baseof.html3
-rw-r--r--layouts/_default/list.html11
2 files changed, 8 insertions, 6 deletions
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" . }}
</main>
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 }}
<article class="list">
<a href="{{ .Page.Permalink }}">
<h2>{{ .Page.Title }}</h2>
</a>
({{ .PublishDate.Format "January 2nd, 2006" }})
<div>
- {{ .Page.Summary }}
+ {{ .Page.Content }}
</div>
- {{- if .Page.Truncated }}
- <a href="{{ .Page.Permalink }}">More</a>
- </div>
- {{ end }}
</article>
{{ end }}
+ {{ template "_internal/pagination.html" . }}
{{ end }}