Skip to content

Commit e6ddc0f

Browse files
authored
Fix sitemap URLs (#3220)
1 parent 373f18f commit e6ddc0f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.changeset/healthy-parrots-call.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"gitbook-v2": patch
3+
"gitbook": patch
4+
---
5+
6+
Fix URL in sitemap

packages/gitbook-v2/src/lib/links.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ export function createLinker(
9393
},
9494

9595
toAbsoluteURL(absolutePath: string): string {
96+
// If the path is already a full URL, we return it as is.
97+
if (URL.canParse(absolutePath)) {
98+
return absolutePath;
99+
}
100+
96101
if (!servedOn.host) {
97102
return absolutePath;
98103
}

0 commit comments

Comments
 (0)