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:
parent
e6aa0cd091
commit
9cafc258c3
2 changed files with 18 additions and 4 deletions
|
@ -164,6 +164,14 @@
|
|||
margin-left: 1em;
|
||||
}
|
||||
|
||||
.ml-2 {
|
||||
margin-left: 2em;
|
||||
}
|
||||
|
||||
.mr-2 {
|
||||
margin-right: 2em;
|
||||
}
|
||||
|
||||
.mw-6 {
|
||||
min-width: 6em;
|
||||
}
|
||||
|
|
|
@ -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 }}
|
Loading…
Reference in a new issue