Sitemap.xml fixed

This commit is contained in:
2026-10-14 11:32:03 +02:00
parent fad5d778e8
commit f4d969ad29
9 changed files with 14 additions and 52 deletions
+2 -13
View File
@@ -27,7 +27,7 @@ import { buildRobots, buildSitemapEntries, createPageMetadata, createSitemapRout
* `resolveRoute` and `getEntries` are separate on purpose: routing decides what
* a URL is, fetching gets the listing. Metadata generation needs the first and
* not the second, and a page component composes them in two obvious lines.
*/ export function createContentHelpers({ baseUrl, config, content, i18n, pagesSlug = 'pages', robots: robotsOptions, settingsSlug = 'site-settings', sitemapStyle, siteNameField = 'siteName' }) {
*/ export function createContentHelpers({ baseUrl, config, content, i18n, pagesSlug = 'pages', robots: robotsOptions, settingsSlug = 'site-settings', sitemapStyle }) {
const origin = baseUrl ?? process.env.NEXT_PUBLIC_SERVER_URL ?? '';
const getCachedPayload = cache(async ()=>getPayload({
config: await config
@@ -318,18 +318,7 @@ import { buildRobots, buildSitemapEntries, createPageMetadata, createSitemapRout
* export { sitemapRoute as GET } from '@/lib/content'
* export const dynamic = 'force-dynamic'
*/ const sitemapRoute = createSitemapRouteHandler(sitemap, {
style: sitemapStyle === false ? false : {
...sitemapStyle,
title: sitemapStyle?.title ?? (async ()=>{
const locale = i18n?.defaultLocale;
if (!locale) {
return undefined;
}
const s = await getSettings(locale);
const name = s?.[siteNameField];
return typeof name === 'string' ? name : undefined;
})
}
style: sitemapStyle ?? {}
});
return {
generatePageMetadata,