Fix empty sitemap (#2685)

This commit is contained in:
Greg Bergé
2025-01-07 17:09:51 +01:00
committed by GitHub
parent 648f0e9e84
commit c30bc24fd6
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'gitbook': patch
---
Fix empty sitemap
@@ -18,7 +18,7 @@ export async function GET(req: NextRequest) {
const { pages: rootPages } = await getSpaceContentData(pointer, pointer.siteShareKey);
const pages = flattenPages(rootPages, (page) => !page.hidden && isPageIndexable([], page));
const urls = Promise.all(
const urls = await Promise.all(
pages.map(async ({ page, depth }) => {
// Decay priority with depth
const priority = Math.pow(2, -0.25 * depth);