michal-sapka-me

Codebase for my homepage.
git clone git://vcs.sapka.me/michal-sapka-me
Log | Files | Refs

commit 7068987d027a25852a1f9255455e07b0511cda20
parent 11b7102a68d7cd812cfeca2e675b2b8416c22a32
Author: Michał M. Sapka <michal@sapka.me>
Date:   Thu, 16 Feb 2023 14:06:34 +0100

chore: modernize pagination

source: rubenerd.com

Diffstat:
Mlayouts/_default/list.html | 9++++++++-
Mstatic/style.css | 11+++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/layouts/_default/list.html b/layouts/_default/list.html @@ -12,5 +12,12 @@ </div> </article> {{ end }} - {{ template "_internal/pagination.html" . }} + +<nav id="pagination"> + <ul> + {{ if .Paginator.HasPrev }}<li id="page-previous"><a href="{{ .Paginator.Prev.URL }}">← Newer</a></li>{{ end }}<li id="page-number"><span>Page {{ .Paginator.PageNumber }} of {{ .Paginator.TotalPages }}</span></li>{{ if .Paginator.HasNext }}<li id="page-next"><a href="{{ .Paginator.Next.URL }}">Older →</a></li>{{ end }} + </ul> +</nav> + + {{ end }} diff --git a/static/style.css b/static/style.css @@ -142,3 +142,14 @@ .pagination li { display: inline-block } + + + /* Page navigation */ +#pagination ul { + text-align:center; +} +#pagination ul li { + display:inline; + padding:0 1em; +} +