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:
1 parent
79da85bcc0
commit
604aeb2a06
1 file changed
+7
@@ -33,6 +33,13 @@ export default defineConfig({
|
|||||||
if (item.links?.length) {
|
if (item.links?.length) {
|
||||||
const def = item.links.find((l) => l.lang === DEFAULT_LOCALE);
|
const def = item.links.find((l) => l.lang === DEFAULT_LOCALE);
|
||||||
if (def) item.links = [...item.links, { url: def.url, lang: "x-default" }];
|
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;
|
return item;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user