@nuxtjs/sitemap 5.3.4 → 6.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/200.html +7 -8
- package/dist/client/404.html +7 -8
- package/dist/client/_nuxt/CY7GV1Ne.js +31 -0
- package/dist/client/_nuxt/{C-T9TBOb.js → D-VsDbcJ.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/8204446e-0708-4f8e-bc4a-e52330d54aba.json +1 -0
- package/dist/client/_nuxt/dsisXUEW.js +1 -0
- package/dist/client/_nuxt/error-404.D56ZPmHb.css +1 -0
- package/dist/client/_nuxt/error-500.BYEp4uQX.css +1 -0
- package/dist/client/index.html +7 -8
- package/dist/module.json +1 -1
- package/dist/module.mjs +58 -19
- package/dist/runtime/nitro/composables/getPathRobotConfigPolyfill.d.ts +2 -1
- package/dist/runtime/nitro/composables/getPathRobotConfigPolyfill.js +1 -1
- package/dist/runtime/nitro/routes/__sitemap__/debug.d.ts +1 -0
- package/dist/runtime/nitro/{middleware/[sitemap]-sitemap.xml.d.ts → routes/sitemap/[sitemap].xml.d.ts} +1 -1
- package/dist/runtime/nitro/routes/sitemap/[sitemap].xml.js +20 -0
- package/dist/runtime/nitro/routes/sitemap.xsl.js +2 -1
- package/dist/runtime/nitro/routes/sitemap_index.xml.js +19 -16
- package/dist/runtime/nitro/sitemap/builder/sitemap-index.d.ts +3 -2
- package/dist/runtime/nitro/sitemap/builder/sitemap-index.js +13 -27
- package/dist/runtime/nitro/sitemap/builder/sitemap.d.ts +9 -2
- package/dist/runtime/nitro/sitemap/builder/sitemap.js +153 -53
- package/dist/runtime/nitro/sitemap/nitro.d.ts +1 -1
- package/dist/runtime/nitro/sitemap/nitro.js +46 -11
- package/dist/runtime/nitro/sitemap/urlset/normalise.d.ts +3 -2
- package/dist/runtime/nitro/sitemap/urlset/normalise.js +64 -53
- package/dist/runtime/types.d.ts +26 -2
- package/dist/runtime/utils-pure.d.ts +2 -1
- package/dist/runtime/utils-pure.js +6 -0
- package/package.json +9 -15
- package/dist/client/_nuxt/CmvLKs5L.js +0 -6
- package/dist/client/_nuxt/Cngs0LGh.js +0 -31
- package/dist/client/_nuxt/DQDIR1cG.js +0 -1
- package/dist/client/_nuxt/builds/meta/fdd10f9a-5193-4fe3-8485-e82e62d50138.json +0 -1
- package/dist/client/_nuxt/error-404.CmJrMD59.css +0 -1
- package/dist/client/_nuxt/error-500.DdKhC0Mw.css +0 -1
- package/dist/runtime/nitro/middleware/[sitemap]-sitemap.xml.js +0 -23
- package/dist/runtime/nitro/sitemap/urlset/filter.d.ts +0 -5
- package/dist/runtime/nitro/sitemap/urlset/filter.js +0 -24
- package/dist/runtime/nitro/sitemap/urlset/i18n.d.ts +0 -6
- package/dist/runtime/nitro/sitemap/urlset/i18n.js +0 -142
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as a,u as s,o as i,c as u,a as e,t as o,b as c,w as d,d as l,e as p,p as h,f as b}from"./Cngs0LGh.js";const f=t=>(h("data-v-81e8316b"),t=t(),b(),t),g={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},x=f(()=>e("div",{class:"fixed left-0 right-0 spotlight z-10"},null,-1)),m={class:"max-w-520px text-center z-20"},y=["textContent"],_=["textContent"],k={class:"w-full flex items-center justify-center"},w={__name:"error-404",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:404},statusMessage:{type:String,default:"Not Found"},description:{type:String,default:"Sorry, the page you are looking for could not be found."},backHome:{type:String,default:"Go back home"}},setup(t){const n=t;return s({title:`${n.statusCode} - ${n.statusMessage} | ${n.appName}`,script:[],style:[{children:'*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:var(--un-default-border-color, #e5e7eb)}:before,:after{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}h1{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}h1,p{margin:0}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(z,S)=>{const r=p;return i(),u("div",g,[x,e("div",m,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:o(t.statusCode)},null,8,y),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:o(t.description)},null,8,_),e("div",k,[c(r,{to:"/",class:"gradient-border text-md sm:text-xl py-2 px-4 sm:py-3 sm:px-6 cursor-pointer"},{default:d(()=>[l(o(t.backHome),1)]),_:1})])])])}}},C=a(w,[["__scopeId","data-v-81e8316b"]]);export{C as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"fdd10f9a-5193-4fe3-8485-e82e62d50138","timestamp":1721037235279,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.spotlight[data-v-81e8316b]{background:linear-gradient(45deg,#00dc82,#36e4da 50%,#0047e1);bottom:-30vh;filter:blur(20vh);height:40vh}.gradient-border[data-v-81e8316b]{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border-radius:.5rem;position:relative}@media (prefers-color-scheme:light){.gradient-border[data-v-81e8316b]{background-color:#ffffff4d}.gradient-border[data-v-81e8316b]:before{background:linear-gradient(90deg,#e2e2e2,#e2e2e2 25%,#00dc82,#36e4da 75%,#0047e1)}}@media (prefers-color-scheme:dark){.gradient-border[data-v-81e8316b]{background-color:#1414144d}.gradient-border[data-v-81e8316b]:before{background:linear-gradient(90deg,#303030,#303030 25%,#00dc82,#36e4da 75%,#0047e1)}}.gradient-border[data-v-81e8316b]:before{background-size:400% auto;border-radius:.5rem;bottom:0;content:"";left:0;-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;opacity:.5;padding:2px;position:absolute;right:0;top:0;transition:background-position .3s ease-in-out,opacity .2s ease-in-out;width:100%}.gradient-border[data-v-81e8316b]:hover:before{background-position:-50% 0;opacity:1}.fixed[data-v-81e8316b]{position:fixed}.left-0[data-v-81e8316b]{left:0}.right-0[data-v-81e8316b]{right:0}.z-10[data-v-81e8316b]{z-index:10}.z-20[data-v-81e8316b]{z-index:20}.grid[data-v-81e8316b]{display:grid}.mb-16[data-v-81e8316b]{margin-bottom:4rem}.mb-8[data-v-81e8316b]{margin-bottom:2rem}.max-w-520px[data-v-81e8316b]{max-width:520px}.min-h-screen[data-v-81e8316b]{min-height:100vh}.w-full[data-v-81e8316b]{width:100%}.flex[data-v-81e8316b]{display:flex}.cursor-pointer[data-v-81e8316b]{cursor:pointer}.place-content-center[data-v-81e8316b]{place-content:center}.items-center[data-v-81e8316b]{align-items:center}.justify-center[data-v-81e8316b]{justify-content:center}.overflow-hidden[data-v-81e8316b]{overflow:hidden}.bg-white[data-v-81e8316b]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-4[data-v-81e8316b]{padding-left:1rem;padding-right:1rem}.px-8[data-v-81e8316b]{padding-left:2rem;padding-right:2rem}.py-2[data-v-81e8316b]{padding-bottom:.5rem;padding-top:.5rem}.text-center[data-v-81e8316b]{text-align:center}.text-8xl[data-v-81e8316b]{font-size:6rem;line-height:1}.text-xl[data-v-81e8316b]{font-size:1.25rem;line-height:1.75rem}.text-black[data-v-81e8316b]{--un-text-opacity:1;color:rgb(0 0 0/var(--un-text-opacity))}.font-light[data-v-81e8316b]{font-weight:300}.font-medium[data-v-81e8316b]{font-weight:500}.leading-tight[data-v-81e8316b]{line-height:1.25}.font-sans[data-v-81e8316b]{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.antialiased[data-v-81e8316b]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (prefers-color-scheme:dark){.dark\:bg-black[data-v-81e8316b]{--un-bg-opacity:1;background-color:rgb(0 0 0/var(--un-bg-opacity))}.dark\:text-white[data-v-81e8316b]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media (min-width:640px){.sm\:px-0[data-v-81e8316b]{padding-left:0;padding-right:0}.sm\:px-6[data-v-81e8316b]{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-3[data-v-81e8316b]{padding-bottom:.75rem;padding-top:.75rem}.sm\:text-4xl[data-v-81e8316b]{font-size:2.25rem;line-height:2.5rem}.sm\:text-xl[data-v-81e8316b]{font-size:1.25rem;line-height:1.75rem}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.spotlight[data-v-737f2409]{background:linear-gradient(45deg,#00dc82,#36e4da 50%,#0047e1);filter:blur(20vh)}.fixed[data-v-737f2409]{position:fixed}.-bottom-1\/2[data-v-737f2409]{bottom:-50%}.left-0[data-v-737f2409]{left:0}.right-0[data-v-737f2409]{right:0}.grid[data-v-737f2409]{display:grid}.mb-16[data-v-737f2409]{margin-bottom:4rem}.mb-8[data-v-737f2409]{margin-bottom:2rem}.h-1\/2[data-v-737f2409]{height:50%}.max-w-520px[data-v-737f2409]{max-width:520px}.min-h-screen[data-v-737f2409]{min-height:100vh}.place-content-center[data-v-737f2409]{place-content:center}.overflow-hidden[data-v-737f2409]{overflow:hidden}.bg-white[data-v-737f2409]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-8[data-v-737f2409]{padding-left:2rem;padding-right:2rem}.text-center[data-v-737f2409]{text-align:center}.text-8xl[data-v-737f2409]{font-size:6rem;line-height:1}.text-xl[data-v-737f2409]{font-size:1.25rem;line-height:1.75rem}.text-black[data-v-737f2409]{--un-text-opacity:1;color:rgb(0 0 0/var(--un-text-opacity))}.font-light[data-v-737f2409]{font-weight:300}.font-medium[data-v-737f2409]{font-weight:500}.leading-tight[data-v-737f2409]{line-height:1.25}.font-sans[data-v-737f2409]{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.antialiased[data-v-737f2409]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (prefers-color-scheme:dark){.dark\:bg-black[data-v-737f2409]{--un-bg-opacity:1;background-color:rgb(0 0 0/var(--un-bg-opacity))}.dark\:text-white[data-v-737f2409]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media (min-width:640px){.sm\:px-0[data-v-737f2409]{padding-left:0;padding-right:0}.sm\:text-4xl[data-v-737f2409]{font-size:2.25rem;line-height:2.5rem}}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { createError, defineEventHandler } from "h3";
|
|
2
|
-
import { parseURL } from "ufo";
|
|
3
|
-
import { useSimpleSitemapRuntimeConfig } from "../utils.js";
|
|
4
|
-
import { createSitemap } from "../sitemap/nitro.js";
|
|
5
|
-
export default defineEventHandler(async (e) => {
|
|
6
|
-
const path = parseURL(e.path).pathname;
|
|
7
|
-
if (!path.endsWith("-sitemap.xml"))
|
|
8
|
-
return;
|
|
9
|
-
const runtimeConfig = useSimpleSitemapRuntimeConfig();
|
|
10
|
-
const { sitemaps } = runtimeConfig;
|
|
11
|
-
const sitemapName = path.replace("-sitemap.xml", "").replace("/", "");
|
|
12
|
-
const isChunking = typeof sitemaps.chunks !== "undefined" && !Number.isNaN(Number(sitemapName));
|
|
13
|
-
if (!(sitemapName in sitemaps) && !isChunking) {
|
|
14
|
-
return createError({
|
|
15
|
-
statusCode: 404,
|
|
16
|
-
message: `Sitemap "${sitemapName}" not found.`
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
return createSitemap(e, isChunking ? {
|
|
20
|
-
...sitemaps.chunks,
|
|
21
|
-
sitemapName
|
|
22
|
-
} : sitemaps[sitemapName], runtimeConfig);
|
|
23
|
-
});
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { H3Event } from 'h3';
|
|
2
|
-
import type { ModuleRuntimeConfig, ResolvedSitemapUrl } from '../../../types.js';
|
|
3
|
-
export declare function filterSitemapUrls(_urls: ResolvedSitemapUrl[], options: Pick<ModuleRuntimeConfig, 'autoI18n' | 'isMultiSitemap'> & Pick<ModuleRuntimeConfig['sitemaps'][string], 'sitemapName' | 'include' | 'exclude'> & {
|
|
4
|
-
event: H3Event;
|
|
5
|
-
}): ResolvedSitemapUrl[];
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { parseURL } from "ufo";
|
|
2
|
-
import { createFilter } from "../../../utils-pure.js";
|
|
3
|
-
import { getPathRobotConfig } from "#imports";
|
|
4
|
-
export function filterSitemapUrls(_urls, options) {
|
|
5
|
-
const urlFilter = createFilter({
|
|
6
|
-
include: options.include,
|
|
7
|
-
exclude: options.exclude
|
|
8
|
-
});
|
|
9
|
-
return _urls.filter((e) => {
|
|
10
|
-
let path = e.loc;
|
|
11
|
-
try {
|
|
12
|
-
path = parseURL(e.loc).pathname;
|
|
13
|
-
} catch {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
if (!urlFilter(path))
|
|
17
|
-
return false;
|
|
18
|
-
if (options.isMultiSitemap && e._sitemap && options.sitemapName)
|
|
19
|
-
return e._sitemap === options.sitemapName;
|
|
20
|
-
if (!getPathRobotConfig(e, { path, skipSiteIndexable: true }).indexable)
|
|
21
|
-
return false;
|
|
22
|
-
return true;
|
|
23
|
-
});
|
|
24
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ModuleRuntimeConfig, ResolvedSitemapUrl, SitemapSourceResolved } from '../../../types.js';
|
|
2
|
-
export declare function normaliseI18nSources(sources: SitemapSourceResolved[], { autoI18n, isI18nMapped, include, exclude }: {
|
|
3
|
-
autoI18n: ModuleRuntimeConfig['autoI18n'];
|
|
4
|
-
isI18nMapped: boolean;
|
|
5
|
-
} & Pick<ModuleRuntimeConfig['sitemaps'][string], 'sitemapName' | 'include' | 'exclude'>): SitemapSourceResolved[];
|
|
6
|
-
export declare function applyI18nEnhancements(_urls: ResolvedSitemapUrl[], options: Pick<Required<ModuleRuntimeConfig>, 'autoI18n' | 'isI18nMapped'> & Pick<ModuleRuntimeConfig['sitemaps'][string], 'sitemapName' | 'include' | 'exclude'>): ResolvedSitemapUrl[];
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import { hasProtocol, joinURL, parseURL, withHttps, withLeadingSlash } from "ufo";
|
|
2
|
-
import { createPathFilter, splitForLocales } from "../../../utils-pure.js";
|
|
3
|
-
export function normaliseI18nSources(sources, { autoI18n, isI18nMapped, include, exclude }) {
|
|
4
|
-
const filterPath = createPathFilter({
|
|
5
|
-
include,
|
|
6
|
-
exclude
|
|
7
|
-
});
|
|
8
|
-
if (autoI18n && isI18nMapped) {
|
|
9
|
-
return sources.map((s) => {
|
|
10
|
-
const urls = (s.urls || []).map((_url) => {
|
|
11
|
-
const url = typeof _url === "string" ? { loc: _url } : _url;
|
|
12
|
-
url.loc = url.loc || url.url;
|
|
13
|
-
if (!hasProtocol(url.loc, { acceptRelative: true }))
|
|
14
|
-
url.loc = withLeadingSlash(url.loc);
|
|
15
|
-
return url;
|
|
16
|
-
});
|
|
17
|
-
s.urls = urls.map((url) => {
|
|
18
|
-
if (url._sitemap || url._i18nTransform)
|
|
19
|
-
return url;
|
|
20
|
-
if (url.loc && !hasProtocol(url.loc, { acceptRelative: true })) {
|
|
21
|
-
const match = splitForLocales(url.loc, autoI18n.locales.map((l) => l.code));
|
|
22
|
-
const localeCode = match[0] || autoI18n.defaultLocale;
|
|
23
|
-
const pathWithoutPrefix = match[1];
|
|
24
|
-
const locale = autoI18n.locales.find((e) => e.code === localeCode);
|
|
25
|
-
if (locale) {
|
|
26
|
-
if (!url.alternatives) {
|
|
27
|
-
const alternatives = urls.map((u) => {
|
|
28
|
-
if (u._sitemap || u._i18nTransform)
|
|
29
|
-
return false;
|
|
30
|
-
if (u?.loc) {
|
|
31
|
-
if (!filterPath(u.loc))
|
|
32
|
-
return false;
|
|
33
|
-
const [_localeCode, _pathWithoutPrefix] = splitForLocales(u.loc, autoI18n.locales.map((l) => l.code));
|
|
34
|
-
if (pathWithoutPrefix === _pathWithoutPrefix) {
|
|
35
|
-
const entries = [];
|
|
36
|
-
if (_localeCode === autoI18n.defaultLocale) {
|
|
37
|
-
entries.push({
|
|
38
|
-
href: u.loc,
|
|
39
|
-
hreflang: "x-default"
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
entries.push({
|
|
43
|
-
href: u.loc,
|
|
44
|
-
hreflang: _localeCode || autoI18n.defaultLocale
|
|
45
|
-
});
|
|
46
|
-
return entries;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return false;
|
|
50
|
-
}).flat().filter(Boolean);
|
|
51
|
-
if (alternatives.length)
|
|
52
|
-
url.alternatives = alternatives;
|
|
53
|
-
}
|
|
54
|
-
return {
|
|
55
|
-
_sitemap: locale.iso || locale.code,
|
|
56
|
-
...url
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return url;
|
|
61
|
-
});
|
|
62
|
-
return s;
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
return sources;
|
|
66
|
-
}
|
|
67
|
-
export function applyI18nEnhancements(_urls, options) {
|
|
68
|
-
const { autoI18n, include, exclude } = options;
|
|
69
|
-
const filterPath = createPathFilter({
|
|
70
|
-
include,
|
|
71
|
-
exclude
|
|
72
|
-
});
|
|
73
|
-
return _urls.map((e) => {
|
|
74
|
-
if (!e._i18nTransform)
|
|
75
|
-
return e;
|
|
76
|
-
delete e._i18nTransform;
|
|
77
|
-
const parsedURL = parseURL(e.loc);
|
|
78
|
-
const path = withLeadingSlash(parsedURL.pathname + parsedURL.search + parsedURL.hash);
|
|
79
|
-
const match = splitForLocales(path, autoI18n.locales.map((l) => l.code));
|
|
80
|
-
let pathWithoutLocale = path;
|
|
81
|
-
let locale;
|
|
82
|
-
if (match[0]) {
|
|
83
|
-
pathWithoutLocale = match[1] || "/";
|
|
84
|
-
locale = match[0];
|
|
85
|
-
}
|
|
86
|
-
if (locale && import.meta.dev) {
|
|
87
|
-
console.warn("You're providing a locale in the url, but the url is marked as inheritI18n. This will cause issues with the sitemap. Please remove the locale from the url.");
|
|
88
|
-
return e;
|
|
89
|
-
}
|
|
90
|
-
if (autoI18n.differentDomains) {
|
|
91
|
-
return {
|
|
92
|
-
// will force it to pass filter
|
|
93
|
-
_sitemap: options.sitemapName,
|
|
94
|
-
...e,
|
|
95
|
-
alternatives: [
|
|
96
|
-
{
|
|
97
|
-
// apply default locale domain
|
|
98
|
-
...autoI18n.locales.find((l) => [l.code, l.iso].includes(autoI18n.defaultLocale)),
|
|
99
|
-
code: "x-default"
|
|
100
|
-
},
|
|
101
|
-
...autoI18n.locales.filter((l) => !!l.domain)
|
|
102
|
-
].map((locale2) => {
|
|
103
|
-
return {
|
|
104
|
-
hreflang: locale2.iso || locale2.code,
|
|
105
|
-
href: joinURL(withHttps(locale2.domain), pathWithoutLocale)
|
|
106
|
-
};
|
|
107
|
-
})
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
return autoI18n.locales.map((l) => {
|
|
111
|
-
let loc = joinURL(`/${l.code}`, pathWithoutLocale);
|
|
112
|
-
if (autoI18n.differentDomains || ["prefix_and_default", "prefix_except_default"].includes(autoI18n.strategy) && l.code === autoI18n.defaultLocale)
|
|
113
|
-
loc = pathWithoutLocale;
|
|
114
|
-
return {
|
|
115
|
-
_sitemap: options.isI18nMapped ? l.iso || l.code : void 0,
|
|
116
|
-
...e,
|
|
117
|
-
loc,
|
|
118
|
-
alternatives: [{ code: "x-default" }, ...autoI18n.locales].map((locale2) => {
|
|
119
|
-
const code = locale2.code === "x-default" ? autoI18n.defaultLocale : locale2.code;
|
|
120
|
-
const isDefault = locale2.code === "x-default" || locale2.code === autoI18n.defaultLocale;
|
|
121
|
-
let href = "";
|
|
122
|
-
if (autoI18n.strategy === "prefix") {
|
|
123
|
-
href = joinURL("/", code, pathWithoutLocale);
|
|
124
|
-
} else if (["prefix_and_default", "prefix_except_default"].includes(autoI18n.strategy)) {
|
|
125
|
-
if (isDefault) {
|
|
126
|
-
href = pathWithoutLocale;
|
|
127
|
-
} else {
|
|
128
|
-
href = joinURL("/", code, pathWithoutLocale);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
const hreflang = locale2.iso || locale2.code;
|
|
132
|
-
if (!filterPath(href))
|
|
133
|
-
return false;
|
|
134
|
-
return {
|
|
135
|
-
hreflang,
|
|
136
|
-
href
|
|
137
|
-
};
|
|
138
|
-
}).filter(Boolean)
|
|
139
|
-
};
|
|
140
|
-
});
|
|
141
|
-
}).flat();
|
|
142
|
-
}
|