Fixed buildSitemapEntries.ts
This commit is contained in:
+7
-1
@@ -110,7 +110,13 @@ import { buildHreflangAlternates } from './hreflang.js';
|
||||
depth: 1,
|
||||
locale: 'all'
|
||||
});
|
||||
const resolvedHomeSlug = homeSlug ?? extractSlugInLocale(settings.homepage, defaultLocale) ?? 'home';
|
||||
// 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 ?? 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.
|
||||
const collections = [
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user