Skip to content

Commit

Permalink
fix(content): markdown files without sitemap not included
Browse files Browse the repository at this point in the history
Fixes #409
  • Loading branch information
harlan-zw committed Jan 20, 2025
1 parent eb02052 commit 7f111f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/server/routes/__sitemap__/nuxt-content-urls-v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export default defineEventHandler(async (e) => {
// now we need to handle multiple queries here, we want to run the requests in parralel
const contentList = []
for (const collection of collections) {
contentList.push(queryCollectionWithEvent(e, collection).select('sitemap').where('sitemap', 'IS NOT NULL').all())
contentList.push(queryCollectionWithEvent(e, collection).select('path', 'sitemap').where('path', 'IS NOT NULL').all())
}
// we need to wait for all the queries to finish
const results = await Promise.all(contentList)
// we need to flatten the results
return results.flat().map(c => c.sitemap).filter(Boolean)
return results.flat().map(c => ({ loc: c.path, ...c.sitemap })).filter(Boolean)
})

0 comments on commit 7f111f7

Please sign in to comment.