Sitemap: self-annotate single-locale pages (privacy) with en + x-default so sitemap alternates match the <head> tags; multi-locale entries unchanged
deploy / build-and-publish (push) Successful in 40s

This commit is contained in:
Keith
2026-11-22 16:13:44 +01:00
parent 79da85bcc0
commit 604aeb2a06
+7
View File
@@ -33,6 +33,13 @@ export default defineConfig({
if (item.links?.length) {
const def = item.links.find((l) => l.lang === DEFAULT_LOCALE);
if (def) item.links = [...item.links, { url: def.url, lang: "x-default" }];
} else {
// single-locale page (e.g. /privacy/, EN-only): self-annotate
// so the sitemap agrees with the <head> tags (en + x-default)
item.links = [
{ url: item.url, lang: DEFAULT_LOCALE },
{ url: item.url, lang: "x-default" },
];
}
return item;
},