From 7f111f7d8cae133853e336ba5d081218f9cdcfa3 Mon Sep 17 00:00:00 2001 From: harlan Date: Mon, 20 Jan 2025 19:51:08 +1100 Subject: [PATCH] fix(content): markdown files without `sitemap` not included Fixes #409 --- src/runtime/server/routes/__sitemap__/nuxt-content-urls-v3.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/server/routes/__sitemap__/nuxt-content-urls-v3.ts b/src/runtime/server/routes/__sitemap__/nuxt-content-urls-v3.ts index 23a0ce4..32cf5fb 100644 --- a/src/runtime/server/routes/__sitemap__/nuxt-content-urls-v3.ts +++ b/src/runtime/server/routes/__sitemap__/nuxt-content-urls-v3.ts @@ -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) })