aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2024-10-07 00:00:00 +0000
committertdro <tdro@noreply.example.com>2024-10-07 00:00:00 +0000
commitb6d53647ed0e1ff7d9e695850fda98b738bcfc7d (patch)
treec8e6c69b2bdfee484fd299410839117edb5e3fef
parentf9d35d043fadf3a92d114a6f4f5f9895f05a66cd (diff)
downloadcanory-b6d53647ed0e1ff7d9e695850fda98b738bcfc7d.tar.gz
canory-b6d53647ed0e1ff7d9e695850fda98b738bcfc7d.tar.bz2
canory-b6d53647ed0e1ff7d9e695850fda98b738bcfc7d.zip
themes/default/layouts/partials/pagination: Guard the paginator
-rw-r--r--themes/default/layouts/partials/pagination.html20
1 files changed, 12 insertions, 8 deletions
diff --git a/themes/default/layouts/partials/pagination.html b/themes/default/layouts/partials/pagination.html
index 524a383..e8a5cb1 100644
--- a/themes/default/layouts/partials/pagination.html
+++ b/themes/default/layouts/partials/pagination.html
@@ -9,9 +9,11 @@
{{- $nextHref := "" | relURL -}}
{{- $lastHref := "" | relURL -}}
- {{- if and .HasPrev .First -}}
- {{- $firstHref = .First.URL | relURL -}}
- {{- $firstTitle = "Newest" -}}
+ {{- with .First -}}
+ {{- if $.Paginator.HasPrev -}}
+ {{- $firstHref = .URL | relURL -}}
+ {{- $firstTitle = "Newest" -}}
+ {{- end -}}
{{- end -}}
{{- with .Prev -}}
@@ -19,14 +21,16 @@
{{- $prevTitle = "Newer" -}}
{{- end -}}
- {{- if .Next -}}
- {{- $nextHref = .Next.URL | relURL -}}
+ {{- with .Next -}}
+ {{- $nextHref = .URL | relURL -}}
{{- $nextTitle = "Older" -}}
{{- end -}}
- {{- if and .HasNext .Last -}}
- {{- $lastHref = .Last.URL | relURL -}}
- {{- $lastTitle = "Oldest" -}}
+ {{- with .Last -}}
+ {{- if $.Paginator.HasNext -}}
+ {{- $lastHref = .URL | relURL -}}
+ {{- $lastTitle = "Oldest" -}}
+ {{- end -}}
{{- end -}}
<nav{{ if le .TotalPages 1 }} hidden="" {{ end }} data-type="pagination">