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
deploy / build-and-publish (push) Successful in 40s
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user