@nuxtjs/sitemap 5.3.5 → 6.0.0-beta.2

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.
Files changed (115) hide show
  1. package/dist/client/200.html +61 -54
  2. package/dist/client/404.html +61 -54
  3. package/dist/client/_nuxt/{D7WeZTai.js → -0RnDExV.js} +1 -1
  4. package/dist/client/_nuxt/{DOtRmeXT.js → -4dSXLqG.js} +1 -1
  5. package/dist/client/_nuxt/458cWEat.js +3 -0
  6. package/dist/client/_nuxt/{CFF2d1j6.js → BEZjiGez.js} +1 -1
  7. package/dist/client/_nuxt/{B3g-KkBK.js → BHqu4VKd.js} +1 -1
  8. package/dist/client/_nuxt/{D33OKbkv.js → BM5XuWfj.js} +1 -1
  9. package/dist/client/_nuxt/BMRpS3Xo.js +1 -0
  10. package/dist/client/_nuxt/{1rqFXsGc.js → BUinYsBq.js} +2 -2
  11. package/dist/client/_nuxt/BXP-NDAE.js +1 -0
  12. package/dist/client/_nuxt/{kuh6G-Sk.js → BZ035FK2.js} +1 -1
  13. package/dist/client/_nuxt/{DrnZp123.js → B_kA2_jD.js} +1 -1
  14. package/dist/client/_nuxt/BgSQePf4.js +1 -0
  15. package/dist/client/_nuxt/{CdedUr_-.js → BiVAY1KT.js} +1 -1
  16. package/dist/client/_nuxt/BpDWT_aG.js +1 -0
  17. package/dist/client/_nuxt/BpJyBuO9.js +1 -0
  18. package/dist/client/_nuxt/{BnyYJeap.js → Bpum8voz.js} +1 -1
  19. package/dist/client/_nuxt/Br9pa-sp.js +1 -0
  20. package/dist/client/_nuxt/BspO9hSn.js +1 -0
  21. package/dist/client/_nuxt/{DAP_O-zg.js → Bx64mzUw.js} +1 -1
  22. package/dist/client/_nuxt/Bym0hRiG.js +1 -0
  23. package/dist/client/_nuxt/C8DXlOXe.js +1 -0
  24. package/dist/client/_nuxt/{ECt0lbkd.js → CBks_G0r.js} +1 -1
  25. package/dist/client/_nuxt/COBxEbHI.js +1 -0
  26. package/dist/client/_nuxt/CPw9RxLe.js +1 -0
  27. package/dist/client/_nuxt/{dIHJ9UdL.js → CRYtL1Hd.js} +1 -1
  28. package/dist/client/_nuxt/CX3ZWouj.js +229 -0
  29. package/dist/client/_nuxt/{0ooBkv16.js → CaGCoJJM.js} +1 -1
  30. package/dist/client/_nuxt/Ctb_e1-I.js +1 -0
  31. package/dist/client/_nuxt/{AGFfX61t.js → CuOLCh11.js} +1 -1
  32. package/dist/client/_nuxt/{JgH_6NEN.js → CxBHuulF.js} +1 -1
  33. package/dist/client/_nuxt/{CJIaz0BQ.js → CxLlwT--.js} +1 -1
  34. package/dist/client/_nuxt/{B6bHXiXE.js → D3VHKxjW.js} +1 -1
  35. package/dist/client/_nuxt/D46m5Xd3.js +1 -0
  36. package/dist/client/_nuxt/D5OoM2Ul.js +1 -0
  37. package/dist/client/_nuxt/D5lQfeOG.js +1 -0
  38. package/dist/client/_nuxt/D8V69RRQ.js +1 -0
  39. package/dist/client/_nuxt/{CX_FIdg1.js → DDK5Hw8n.js} +1 -1
  40. package/dist/client/_nuxt/{C1yTBzia.js → DIyf2Ztx.js} +1 -1
  41. package/dist/client/_nuxt/{BZfs-ost.js → DOv5BRyJ.js} +1 -1
  42. package/dist/client/_nuxt/DQ-rpzxz.js +1 -0
  43. package/dist/client/_nuxt/DUsrs60I.js +6 -0
  44. package/dist/client/_nuxt/DV9_Ze0W.js +1 -0
  45. package/dist/client/_nuxt/{Bxkoe-BC.js → EQHFthT6.js} +1 -1
  46. package/dist/client/_nuxt/Ev-gWqHG.js +1 -0
  47. package/dist/client/_nuxt/{BacI6-DX.js → FRbOFgZn.js} +1 -1
  48. package/dist/client/_nuxt/{CqYeW6XZ.js → Gme1ZbSQ.js} +1 -1
  49. package/dist/client/_nuxt/{Br6ll-O0.js → NrGJGX17.js} +1 -1
  50. package/dist/client/_nuxt/{CarfVElc.js → ULUzDaxg.js} +1 -1
  51. package/dist/client/_nuxt/USEQoosB.js +31 -0
  52. package/dist/client/_nuxt/{DGDuLtS6.js → V16qqttt.js} +1 -1
  53. package/dist/client/_nuxt/builds/latest.json +1 -1
  54. package/dist/client/_nuxt/builds/meta/99e0fea3-c4e8-45fe-88b0-f49b86d00f5b.json +1 -0
  55. package/dist/client/_nuxt/d42HzezM.js +1 -0
  56. package/dist/client/_nuxt/entry.BnSVD-Km.css +1 -0
  57. package/dist/client/_nuxt/error-404.BOXiSWAJ.css +1 -0
  58. package/dist/client/_nuxt/error-500.DmKlUOlN.css +1 -0
  59. package/dist/client/_nuxt/{BXR915QZ.js → ewRyznZJ.js} +1 -1
  60. package/dist/client/_nuxt/{BVLuctcA.js → vMuZBeRS.js} +1 -1
  61. package/dist/client/_nuxt/{Bj5xdiaE.js → xuIuMB9j.js} +1 -1
  62. package/dist/client/_nuxt/{ChMCFiS0.js → zIdFMUa4.js} +1 -1
  63. package/dist/client/_nuxt/{BVkeqZ59.js → zbShYgi7.js} +1 -1
  64. package/dist/client/index.html +61 -54
  65. package/dist/module.d.mts +355 -1
  66. package/dist/module.d.ts +355 -1
  67. package/dist/module.json +2 -2
  68. package/dist/module.mjs +178 -32
  69. package/dist/runtime/nitro/composables/getPathRobotConfigPolyfill.d.ts +2 -1
  70. package/dist/runtime/nitro/composables/getPathRobotConfigPolyfill.js +1 -1
  71. package/dist/runtime/nitro/routes/__sitemap__/debug.d.ts +8 -6
  72. package/dist/runtime/nitro/{middleware/[sitemap]-sitemap.xml.d.ts → routes/sitemap/[sitemap].xml.d.ts} +1 -1
  73. package/dist/runtime/nitro/routes/sitemap/[sitemap].xml.js +20 -0
  74. package/dist/runtime/nitro/routes/sitemap.xsl.js +2 -1
  75. package/dist/runtime/nitro/routes/sitemap_index.xml.js +19 -16
  76. package/dist/runtime/nitro/sitemap/builder/sitemap-index.d.ts +3 -2
  77. package/dist/runtime/nitro/sitemap/builder/sitemap-index.js +14 -28
  78. package/dist/runtime/nitro/sitemap/builder/sitemap.d.ts +9 -2
  79. package/dist/runtime/nitro/sitemap/builder/sitemap.js +154 -54
  80. package/dist/runtime/nitro/sitemap/builder/xml.d.ts +1 -1
  81. package/dist/runtime/nitro/sitemap/builder/xml.js +2 -0
  82. package/dist/runtime/nitro/sitemap/nitro.d.ts +1 -1
  83. package/dist/runtime/nitro/sitemap/nitro.js +47 -11
  84. package/dist/runtime/nitro/sitemap/urlset/normalise.d.ts +3 -2
  85. package/dist/runtime/nitro/sitemap/urlset/normalise.js +64 -53
  86. package/dist/runtime/types.d.ts +35 -4
  87. package/dist/runtime/utils-pure.d.ts +2 -1
  88. package/dist/runtime/utils-pure.js +6 -0
  89. package/package.json +24 -25
  90. package/dist/client/_nuxt/3ghuYFLd.js +0 -1
  91. package/dist/client/_nuxt/9B1nZgL-.js +0 -1
  92. package/dist/client/_nuxt/BG-qYwi8.js +0 -6
  93. package/dist/client/_nuxt/BIxS-Weu.js +0 -1
  94. package/dist/client/_nuxt/BYdKNJ10.js +0 -1
  95. package/dist/client/_nuxt/Bi43K_FX.js +0 -6
  96. package/dist/client/_nuxt/CBPJd_fO.js +0 -1
  97. package/dist/client/_nuxt/CCqFro8U.js +0 -3
  98. package/dist/client/_nuxt/CEfge3mM.js +0 -1
  99. package/dist/client/_nuxt/CSPeAESR.js +0 -1
  100. package/dist/client/_nuxt/D0mw_hZ2.js +0 -31
  101. package/dist/client/_nuxt/DGO8GyiP.js +0 -1
  102. package/dist/client/_nuxt/DOHBU7tp.js +0 -1
  103. package/dist/client/_nuxt/DQoqAi02.js +0 -1
  104. package/dist/client/_nuxt/DVLwECkk.js +0 -1
  105. package/dist/client/_nuxt/Du6_OKDb.js +0 -159
  106. package/dist/client/_nuxt/builds/meta/ab2ad6a2-f67d-4194-8e33-d46fbc5d1290.json +0 -1
  107. package/dist/client/_nuxt/eJfcURhx.js +0 -1
  108. package/dist/client/_nuxt/entry.CfxF9LiM.css +0 -1
  109. package/dist/client/_nuxt/error-404.D56ZPmHb.css +0 -1
  110. package/dist/client/_nuxt/error-500.BYEp4uQX.css +0 -1
  111. package/dist/runtime/nitro/middleware/[sitemap]-sitemap.xml.js +0 -23
  112. package/dist/runtime/nitro/sitemap/urlset/filter.d.ts +0 -5
  113. package/dist/runtime/nitro/sitemap/urlset/filter.js +0 -24
  114. package/dist/runtime/nitro/sitemap/urlset/i18n.d.ts +0 -6
  115. package/dist/runtime/nitro/sitemap/urlset/i18n.js +0 -142
@@ -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
- }