sitemap module wont show dynamic routes, routes are empty
we tried to create on root ebene ( /server/api/sitemap/urls.ts ) the following
in the images you can see our nuxt config.
its like we wont even get in to the urls.ts file
import { asSitemapUrl, defineSitemapEventHandler } from '#imports'
export default defineSitemapEventHandler(async () => {
const [pages, sub_pages, instructions] = await Promise.all([
//
$fetch("$cdnurl$/items/pages").then((p) =>
p.data.map((item) => ({
loc: item.slug,
_sitemap: "pages",
}))
),
$fetch(
"$cdnurl$/items/sub_pages?fields=translations.slug"
).then((sp) =>
sp.data.map((item) => ({
loc: `/support/${item.translations[0].slug}`,
_sitemap: "sub_pages",
}))
),
$fetch(
"$cdnurl$/items/Instructions?fields=translations.slug"
).then((s) =>
s.data.map((p) => ({
loc: `/support/${p.translations[0].slug}`,
_sitemap: "instructions",
}))
),
]);
return [...pages, ...sub_pages, ...instructions].map((p) => asSitemapUrl({
return { loc: p.url, lastmod: p.updatedAt };
}));
});import { asSitemapUrl, defineSitemapEventHandler } from '#imports'
export default defineSitemapEventHandler(async () => {
const [pages, sub_pages, instructions] = await Promise.all([
//
$fetch("$cdnurl$/items/pages").then((p) =>
p.data.map((item) => ({
loc: item.slug,
_sitemap: "pages",
}))
),
$fetch(
"$cdnurl$/items/sub_pages?fields=translations.slug"
).then((sp) =>
sp.data.map((item) => ({
loc: `/support/${item.translations[0].slug}`,
_sitemap: "sub_pages",
}))
),
$fetch(
"$cdnurl$/items/Instructions?fields=translations.slug"
).then((s) =>
s.data.map((p) => ({
loc: `/support/${p.translations[0].slug}`,
_sitemap: "instructions",
}))
),
]);
return [...pages, ...sub_pages, ...instructions].map((p) => asSitemapUrl({
return { loc: p.url, lastmod: p.updatedAt };
}));
});in the images you can see our nuxt config.
its like we wont even get in to the urls.ts file

