From fe1a9c08f0f545d0976c11c5aee16d09c0475d06 Mon Sep 17 00:00:00 2001 From: tobySolutions Date: Tue, 15 Oct 2024 19:24:42 +0100 Subject: [PATCH] chore: pulling --- src/utils/generateCanonicalUrl.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/utils/generateCanonicalUrl.ts b/src/utils/generateCanonicalUrl.ts index 4ef38561..8b6fed29 100644 --- a/src/utils/generateCanonicalUrl.ts +++ b/src/utils/generateCanonicalUrl.ts @@ -1,9 +1,5 @@ export function generateCanonicalUrl(baseUrl: string, slug?: string) { if (!slug) return baseUrl; - if (slug === 'docs/') { - return `${baseUrl}/${slug}`; - } - - return `${baseUrl}/${slug}/`; + return `${baseUrl}/${slug.replace(/\/$/, '')}/`; }