summaryrefslogtreecommitdiffhomepage
path: root/tpl
diff options
context:
space:
mode:
authorJoe Mooring <[email protected]>2020-07-31 07:35:22 -0400
committerBjørn Erik Pedersen <[email protected]>2020-07-31 16:08:23 +0200
commit2fa851e6500752c0cea1da5cfdfc6d99e0a81a71 (patch)
tree4a34bcecfff880142ac6abe25ec689491b237be3 /tpl
parent21dbfa1f111ca2f066e06af68f267932ce6cf04f (diff)
downloadhugo-2fa851e6500752c0cea1da5cfdfc6d99e0a81a71.tar.gz
hugo-2fa851e6500752c0cea1da5cfdfc6d99e0a81a71.zip
Fix ellipsis display logic in pagination template
Closes #7523
Diffstat (limited to 'tpl')
-rw-r--r--tpl/tplimpl/embedded/templates.autogen.go3
-rw-r--r--tpl/tplimpl/embedded/templates/pagination.html3
2 files changed, 2 insertions, 4 deletions
diff --git a/tpl/tplimpl/embedded/templates.autogen.go b/tpl/tplimpl/embedded/templates.autogen.go
index 190c88e32..89dd1d469 100644
--- a/tpl/tplimpl/embedded/templates.autogen.go
+++ b/tpl/tplimpl/embedded/templates.autogen.go
@@ -260,8 +260,7 @@ if (!doNotTrack) {
{{- $shouldEllipse := false -}}
{{- range $pag.Pagers -}}
{{- $right := sub .TotalPages .PageNumber -}}
- {{- $showNumber := or (le .PageNumber 3) (eq $right 0) -}}
- {{- $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 2)) (lt .PageNumber (add $pag.PageNumber 2))) -}}
+ {{- $showNumber := or (eq .TotalPages 5) (le .PageNumber 3) (eq $right 0) -}}
{{- if $showNumber -}}
{{- $ellipsed = false -}}
{{- $shouldEllipse = false -}}
diff --git a/tpl/tplimpl/embedded/templates/pagination.html b/tpl/tplimpl/embedded/templates/pagination.html
index 7b60c5d05..3c8a7e393 100644
--- a/tpl/tplimpl/embedded/templates/pagination.html
+++ b/tpl/tplimpl/embedded/templates/pagination.html
@@ -13,8 +13,7 @@
{{- $shouldEllipse := false -}}
{{- range $pag.Pagers -}}
{{- $right := sub .TotalPages .PageNumber -}}
- {{- $showNumber := or (le .PageNumber 3) (eq $right 0) -}}
- {{- $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 2)) (lt .PageNumber (add $pag.PageNumber 2))) -}}
+ {{- $showNumber := or (eq .TotalPages 5) (le .PageNumber 3) (eq $right 0) -}}
{{- if $showNumber -}}
{{- $ellipsed = false -}}
{{- $shouldEllipse = false -}}