Merge pull request #7 from zonggen/fix-paginator

paginator: quick fix on newer/older btn
This commit is contained in:
XJJ 2021-08-17 00:17:37 +08:00 committed by GitHub
commit 34767350d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 }}
{{ end }}