Fixed buildSitemapEntries.ts
This commit is contained in:
@@ -159,8 +159,17 @@ export async function buildSitemapEntries({
|
||||
locale: 'all' as never,
|
||||
})) as Record<string, unknown>
|
||||
|
||||
// Home slug as a per-locale MAP so every language's homepage collapses to its
|
||||
// root in the sitemap (/pl, /de, /en) — not just the default locale. Priority:
|
||||
// caller-provided homeSlug > full map from the homepage relationship > single
|
||||
// default-locale slug > 'home'. slugMapAllLocales already builds the map (it's
|
||||
// used for archive prefixes below); reusing it here fixes /de/startseite
|
||||
// appearing in the sitemap instead of /de.
|
||||
const resolvedHomeSlug =
|
||||
homeSlug ?? extractSlugInLocale(settings.homepage, defaultLocale) ?? 'home'
|
||||
homeSlug ??
|
||||
slugMapAllLocales(settings.homepage, locales) ??
|
||||
extractSlugInLocale(settings.homepage, defaultLocale) ??
|
||||
'home'
|
||||
|
||||
// Which collections to walk: pages (no prefix) + each content collection with
|
||||
// its archive-page slugs as the localized prefix.
|
||||
|
||||
Reference in New Issue
Block a user