Skip to content

Commit 73e57b5

Browse files
committed
Merge branch 'main' into claire/rnd-6959-add-support-for-tabs-links-in-gbo
* main: Use absolute URLs in sitemap.xml when pointing to sitemap-pages.xml (#3210)
2 parents 6076222 + 0499966 commit 73e57b5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/real-donkeys-invent.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gitbook": patch
3+
---
4+
5+
Fix invalid sitemap.xml generated with relative URLs instead of absolute ones

packages/gitbook/src/routes/sitemap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function getUrlsFromSiteSpaces(context: GitBookSiteContext, siteSpaces: SiteSpac
141141
}
142142
const url = new URL(siteSpace.urls.published);
143143
url.pathname = joinPath(url.pathname, 'sitemap-pages.xml');
144-
return context.linker.toLinkForContent(url.toString());
144+
return context.linker.toAbsoluteURL(context.linker.toLinkForContent(url.toString()));
145145
}, []);
146146
return urls.filter(filterOutNullable);
147147
}

0 commit comments

Comments
 (0)