commit d3f879abe1e305e246349f57dbcc5238466be7aa
parent 1bfbc33381fbc0944571f3a90c39bab89d5c7449
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date: Sat, 7 Jan 2023 22:22:45 -0500
Fix page number showing 1 despite there being 0 total pages
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/layouts/partials/nav_page.html b/layouts/partials/nav_page.html
@@ -1,6 +1,6 @@
{{ if .IsNode }}
{{ $pag := partial "get_paginator.html" . }}
{{ if $pag.HasNext }}<a href="{{ $pag.Next.URL }}">←</a>{{ else }}←{{ end }}
-{{ $pag.PageNumber }}/{{ $pag.TotalPages }}
+{{ if (eq $pag.TotalPages 0) }}0{{ else }}{{ $pag.PageNumber }}{{ end }}/{{ $pag.TotalPages }}
{{ if $pag.HasPrev }}<a href="{{ $pag.Prev.URL }}">→</a>{{ else }}→{{ end }}
{{ end }}