From 86ebff52e26d66e290398118d1b229315ff3602f Mon Sep 17 00:00:00 2001 From: GauthierWebDev Date: Fri, 18 Apr 2025 10:22:12 +0200 Subject: [PATCH 1/2] style: Update line heights and margins in PrevNextLinks --- app/components/syntax/PrevNextLinks.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/syntax/PrevNextLinks.tsx b/app/components/syntax/PrevNextLinks.tsx index 990613a..c5be2e3 100644 --- a/app/components/syntax/PrevNextLinks.tsx +++ b/app/components/syntax/PrevNextLinks.tsx @@ -40,9 +40,9 @@ function PageLink({ >

{pageCategory && ( - {pageCategory.title} + {pageCategory.title} )} - {title} + {title}

-- 2.45.2 From be98d93c9a653a7f56734f7dd8920694137d1236 Mon Sep 17 00:00:00 2001 From: GauthierWebDev Date: Fri, 18 Apr 2025 10:23:40 +0200 Subject: [PATCH 2/2] fix: Update logic to skip next page if it's the same --- app/components/syntax/PrevNextLinks.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/components/syntax/PrevNextLinks.tsx b/app/components/syntax/PrevNextLinks.tsx index c5be2e3..68ed673 100644 --- a/app/components/syntax/PrevNextLinks.tsx +++ b/app/components/syntax/PrevNextLinks.tsx @@ -65,7 +65,13 @@ export function PrevNextLinks() { if (linkIndex === -1) return [null, null]; const previousPage = allLinks[linkIndex - 1] || null; - const nextPage = allLinks[linkIndex + 1] || null; + let nextPage = allLinks[linkIndex + 1] || null; + + // In case the next page is the same as the current page (in subitems), + // we need to skip it to get the correct next page. + if (nextPage.href === urlPathname) { + nextPage = allLinks[linkIndex + 2] || null; + } return [previousPage, nextPage]; }; -- 2.45.2