Skip to content

Commit fc8065b

Browse files
authored
Revert "Fix canonical URL ending with "/" (#2586)" (#2588)
1 parent 28f1ed9 commit fc8065b

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

packages/gitbook/src/lib/links.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,9 @@ export function baseUrl(): string {
7979

8080
/**
8181
* Create an absolute href in the current content.
82-
* If it's the root URL, the trailing slash will be removed.
8382
*/
8483
export function absoluteHref(href: string, withHost: boolean = false): string {
8584
const base = withHost ? baseUrl() : basePath();
86-
if (href === '') {
87-
// Remove the trailing slash if it's the root URL
88-
return base.slice(0, -1);
89-
}
9085
return `${base}${href.startsWith('/') ? href.slice(1) : href}`;
9186
}
9287

0 commit comments

Comments
 (0)