diff options
author | Michał M. Sapka <michal@sapka.me> | 2023-02-16 14:06:34 +0100 |
---|---|---|
committer | Michał M. Sapka <michal@sapka.me> | 2023-02-16 14:06:34 +0100 |
commit | 7068987d027a25852a1f9255455e07b0511cda20 (patch) | |
tree | 9107d39d6a7e96cc4ada89e43b1b6e636aec0275 | |
parent | 11b7102a68d7cd812cfeca2e675b2b8416c22a32 (diff) |
chore: modernize pagination
source: rubenerd.com
-rw-r--r-- | layouts/_default/list.html | 9 | ||||
-rw-r--r-- | static/style.css | 11 |
2 files changed, 19 insertions, 1 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 4828ebb..e8a2608 100644 --- 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 index c31d36b..c6222c9 100644 --- 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; +} + |