From 7970511402b14a1d6f4256874bdf355c25c0d521 Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Mon, 14 Nov 2022 13:23:44 +1100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20last=20pagination=20link?= =?UTF-8?q?=20displayed=20twice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + layouts/partials/pagination.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b7a26e2..222c7355 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - List page doesn't render nested list pages ([#365](https://github.com/jpanther/congo/issues/365)) - Pagination is duplicated on term pages ([#366](https://github.com/jpanther/congo/issues/366)) +- Link to last pagination page sometimes displays twice ## [2.4.0] - 2022-11-10 diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html index 4228b332..3d8e88ec 100644 --- a/layouts/partials/pagination.html +++ b/layouts/partials/pagination.html @@ -59,7 +59,7 @@ {{- end }} {{- with .Last }} - {{- if lt $currentPageNumber (sub .TotalPages $width) }} + {{- if and (lt $currentPageNumber (sub .TotalPages $width)) (lt $end .TotalPages) }} {{- if lt $currentPageNumber (sub .TotalPages (add $width 1)) }}