From fc8065b7a81f7cf4aebec7c8e27c9a4e2a39f256 Mon Sep 17 00:00:00 2001 From: spastorelli Date: Wed, 27 Nov 2024 13:05:34 +0100 Subject: [PATCH] Revert "Fix canonical URL ending with "/" (#2586)" (#2588) --- packages/gitbook/src/lib/links.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/gitbook/src/lib/links.ts b/packages/gitbook/src/lib/links.ts index 8a2522bd7..5acf816d1 100644 --- a/packages/gitbook/src/lib/links.ts +++ b/packages/gitbook/src/lib/links.ts @@ -79,14 +79,9 @@ export function baseUrl(): string { /** * Create an absolute href in the current content. - * If it's the root URL, the trailing slash will be removed. */ export function absoluteHref(href: string, withHost: boolean = false): string { const base = withHost ? baseUrl() : basePath(); - if (href === '') { - // Remove the trailing slash if it's the root URL - return base.slice(0, -1); - } return `${base}${href.startsWith('/') ? href.slice(1) : href}`; }