Skip to content

Commit 0499966

Browse files
authored
Use absolute URLs in sitemap.xml when pointing to sitemap-pages.xml (#3210)
1 parent f7a3470 commit 0499966

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/real-donkeys-invent.md

+5
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

+1-1
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)