paginator: quick fix on newer/older btn

Fixes: https://github.com/Mivinci/hugo-theme-minima/issues/6
Signed-off-by: Allen Bai <carpe.diem.allen@gmail.com>
This commit is contained in:
Allen Bai 2021-08-15 17:09:59 -04:00
parent e6aa0cd091
commit 9cafc258c3
No known key found for this signature in database
GPG key ID: B84ACCBA217671D4
2 changed files with 18 additions and 4 deletions

View file

@ -164,6 +164,14 @@
margin-left: 1em;
}
.ml-2 {
margin-left: 2em;
}
.mr-2 {
margin-right: 2em;
}
.mw-6 {
min-width: 6em;
}

View file

@ -1,10 +1,16 @@
{{ $page := $.Paginator }}
{{ if gt $page.TotalPages 1 }}
<div class="mt-2">
{{ if $page.HasNext }}
<a href="{{ $page.Next.URL }}">Older →</a>
{{ if $page.HasPrev }}
<a href="{{ $page.Prev.URL }}" class="mr-2">← Newer</a>
{{ else }}
<a href="{{ $page.Prev.URL }}">← Newer</a>
<span class="mr-2">← Newer</span>
{{ end }}
{{ if $page.HasNext }}
<a href="{{ $page.Next.URL }}" class="ml-2">Older →</a>
{{ else }}
<span class="ml-2">Older →</span>
{{ end }}
</div>
{{ end }}