From 2f078fb56d5d7e7210034a7eec609d0d75357803 Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Sun, 10 Mar 2024 15:27:22 +0100 Subject: [PATCH] chg: [layout] Voici la fin --- themes/writeonly/layouts/_default/list.html | 2 +- themes/writeonly/layouts/index.html | 2 +- .../layouts/partials/shared/pagination.html | 87 +++++++++++++++++++ 3 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 themes/writeonly/layouts/partials/shared/pagination.html diff --git a/themes/writeonly/layouts/_default/list.html b/themes/writeonly/layouts/_default/list.html index 3ba0d44..708ff44 100644 --- a/themes/writeonly/layouts/_default/list.html +++ b/themes/writeonly/layouts/_default/list.html @@ -9,7 +9,7 @@
- {{ template "_internal/pagination.html" . }} + {{ partial "shared/pagination.html" . }}
{{ end }} diff --git a/themes/writeonly/layouts/index.html b/themes/writeonly/layouts/index.html index aed5a3e..4e26f1d 100644 --- a/themes/writeonly/layouts/index.html +++ b/themes/writeonly/layouts/index.html @@ -13,7 +13,7 @@
- {{ template "_internal/pagination.html" . }} + {{ partial "shared/pagination.html" . }}
{{ end }} diff --git a/themes/writeonly/layouts/partials/shared/pagination.html b/themes/writeonly/layouts/partials/shared/pagination.html new file mode 100644 index 0000000..20ffcb5 --- /dev/null +++ b/themes/writeonly/layouts/partials/shared/pagination.html @@ -0,0 +1,87 @@ +{{ $paginator := $.Paginator }} + +{{ $adjacent_links := 2 }} + +{{ $max_links := (add (mul $adjacent_links 2) 1) }} + +{{ $lower_limit := (add $adjacent_links 1) }} + +{{ $upper_limit := (sub $paginator.TotalPages $adjacent_links) }} + +{{ if gt $paginator.TotalPages 1 }} + +{{ end }}