From e50a5668a1820ceb9e47398c48a04956601fb172 Mon Sep 17 00:00:00 2001 From: prototypa Date: Fri, 4 Nov 2022 02:40:07 +0100 Subject: [PATCH] Fix permalinks with trailing slash in paginations --- src/components/atoms/Pagination.astro | 5 +++-- src/utils/permalinks.js | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/atoms/Pagination.astro b/src/components/atoms/Pagination.astro index 1604c2d..f0b4026 100644 --- a/src/components/atoms/Pagination.astro +++ b/src/components/atoms/Pagination.astro @@ -1,5 +1,6 @@ --- import { Icon } from 'astro-icon'; +import { getPermalink } from '~/utils/permalinks'; const { prevUrl, nextUrl, prevText = 'Newer posts', nextText = 'Older posts' } = Astro.props; --- @@ -8,7 +9,7 @@ const { prevUrl, nextUrl, prevText = 'Newer posts', nextText = 'Older posts' } =
{ case 'post': return createPath(basePathname, POST_BASE, _slug); + case 'raw': + return createPath(basePathname, trimSlash(slug)); + case 'page': default: return createPath(basePathname, _slug);