@nuxtjs/sitemap 7.4.7 → 7.4.8
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/README.md +1 -1
- package/dist/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/BD3NqoLn.js +1 -0
- package/dist/client/_nuxt/CGPPaMu7.js +1 -0
- package/dist/client/_nuxt/HdjdXzAy.js +157 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/61bb4b51-7d01-424f-91fb-0e4ca01f7b22.json +1 -0
- package/dist/client/_nuxt/{entry.D5V0t8Hh.css → entry.Ci1pP-eR.css} +1 -1
- package/dist/client/_nuxt/error-404.i2ufnNET.css +1 -0
- package/dist/client/_nuxt/error-500.CIrNTbBE.css +1 -0
- package/dist/client/index.html +1 -1
- package/dist/client/sitemap.xml +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +190 -141
- package/dist/runtime/server/plugins/compression.d.ts +1 -1
- package/dist/runtime/server/plugins/nuxt-content-v2.d.ts +1 -1
- package/dist/runtime/server/plugins/warm-up.d.ts +1 -1
- package/dist/runtime/server/routes/__sitemap__/debug.d.ts +5 -0
- package/dist/runtime/server/routes/__sitemap__/debug.js +5 -3
- package/dist/runtime/server/sitemap/builder/sitemap.js +2 -0
- package/dist/runtime/server/sitemap/urlset/sources.js +20 -4
- package/dist/runtime/types.d.ts +1 -1
- package/dist/shared/{sitemap.DR3_6qqU.mjs → sitemap.Bj0OAEtK.mjs} +12 -1
- package/dist/utils.d.mts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.mjs +1 -1
- package/package.json +25 -25
- package/virtual.d.ts +4 -0
- package/dist/client/_nuxt/CVMmb_pX.js +0 -1
- package/dist/client/_nuxt/Uwg2rjhu.js +0 -172
- package/dist/client/_nuxt/builds/meta/d2f0f6ff-dbbc-45cd-bac8-0f24a0d6c572.json +0 -1
- package/dist/client/_nuxt/error-404.BXx3NK2Z.css +0 -1
- package/dist/client/_nuxt/error-500.BYrbHUTO.css +0 -1
- package/dist/client/_nuxt/rHMUQZkV.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("nitropack").NitroAppPlugin;
|
|
1
|
+
declare const _default: import("nitropack/types").NitroAppPlugin;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("nitropack").NitroAppPlugin;
|
|
1
|
+
declare const _default: import("nitropack/types").NitroAppPlugin;
|
|
2
2
|
export default _default;
|
|
@@ -36,5 +36,10 @@ declare const _default: import("h3").EventHandler<import("h3").EventHandlerReque
|
|
|
36
36
|
minify: boolean;
|
|
37
37
|
};
|
|
38
38
|
globalSources: import("../../../types.js").SitemapSourceResolved[];
|
|
39
|
+
siteConfig: {
|
|
40
|
+
[x: string]: any;
|
|
41
|
+
[x: number]: any;
|
|
42
|
+
url: string;
|
|
43
|
+
};
|
|
39
44
|
}>>;
|
|
40
45
|
export default _default;
|
|
@@ -5,14 +5,15 @@ import {
|
|
|
5
5
|
globalSitemapSources,
|
|
6
6
|
resolveSitemapSources
|
|
7
7
|
} from "../../sitemap/urlset/sources.js";
|
|
8
|
-
import {
|
|
8
|
+
import { getNitroOrigin, getSiteConfig } from "#site-config/server/composables";
|
|
9
9
|
export default defineEventHandler(async (e) => {
|
|
10
10
|
const _runtimeConfig = useSitemapRuntimeConfig();
|
|
11
|
+
const siteConfig = getSiteConfig(e);
|
|
11
12
|
const { sitemaps: _sitemaps } = _runtimeConfig;
|
|
12
13
|
const runtimeConfig = { ..._runtimeConfig };
|
|
13
14
|
delete runtimeConfig.sitemaps;
|
|
14
15
|
const globalSources = await globalSitemapSources();
|
|
15
|
-
const nitroOrigin =
|
|
16
|
+
const nitroOrigin = getNitroOrigin(e);
|
|
16
17
|
const sitemaps = {};
|
|
17
18
|
for (const s of Object.keys(_sitemaps)) {
|
|
18
19
|
sitemaps[s] = {
|
|
@@ -24,6 +25,7 @@ export default defineEventHandler(async (e) => {
|
|
|
24
25
|
nitroOrigin,
|
|
25
26
|
sitemaps,
|
|
26
27
|
runtimeConfig,
|
|
27
|
-
globalSources: await resolveSitemapSources(globalSources, e)
|
|
28
|
+
globalSources: await resolveSitemapSources(globalSources, e),
|
|
29
|
+
siteConfig: { ...siteConfig }
|
|
28
30
|
};
|
|
29
31
|
});
|
|
@@ -230,6 +230,8 @@ export async function buildSitemapUrls(sitemap, resolvers, runtimeConfig, nitro)
|
|
|
230
230
|
await nitro?.hooks.callHook("sitemap:input", resolvedCtx);
|
|
231
231
|
const enhancedUrls = resolveSitemapEntries(sitemap, resolvedCtx.urls, { autoI18n, isI18nMapped }, resolvers);
|
|
232
232
|
const filteredUrls = enhancedUrls.filter((e) => {
|
|
233
|
+
if (e._sitemap === false)
|
|
234
|
+
return false;
|
|
233
235
|
if (isMultiSitemap && e._sitemap && sitemap.sitemapName)
|
|
234
236
|
return e._sitemap === sitemap.sitemapName;
|
|
235
237
|
return true;
|
|
@@ -116,11 +116,27 @@ export async function fetchDataSource(input, event) {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
export function globalSitemapSources() {
|
|
120
|
-
|
|
119
|
+
export async function globalSitemapSources() {
|
|
120
|
+
if (import.meta.prerender) {
|
|
121
|
+
const { readSourcesFromFilesystem } = await import("#sitemap-virtual/read-sources.mjs");
|
|
122
|
+
const sources = await readSourcesFromFilesystem("global-sources.json");
|
|
123
|
+
if (sources)
|
|
124
|
+
return sources;
|
|
125
|
+
}
|
|
126
|
+
const m = await import("#sitemap-virtual/global-sources.mjs");
|
|
127
|
+
return m.sources;
|
|
121
128
|
}
|
|
122
|
-
export function childSitemapSources(definition) {
|
|
123
|
-
|
|
129
|
+
export async function childSitemapSources(definition) {
|
|
130
|
+
if (!definition?._hasSourceChunk)
|
|
131
|
+
return [];
|
|
132
|
+
if (import.meta.prerender) {
|
|
133
|
+
const { readSourcesFromFilesystem } = await import("#sitemap-virtual/read-sources.mjs");
|
|
134
|
+
const allSources = await readSourcesFromFilesystem("child-sources.json");
|
|
135
|
+
if (allSources)
|
|
136
|
+
return allSources[definition.sitemapName] || [];
|
|
137
|
+
}
|
|
138
|
+
const m = await import("#sitemap-virtual/child-sources.mjs");
|
|
139
|
+
return m.sources[definition.sitemapName] || [];
|
|
124
140
|
}
|
|
125
141
|
export async function resolveSitemapSources(sources, event) {
|
|
126
142
|
return (await Promise.all(
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -370,7 +370,7 @@ export interface SitemapUrl {
|
|
|
370
370
|
images?: Array<ImageEntry>;
|
|
371
371
|
videos?: Array<VideoEntry>;
|
|
372
372
|
_i18nTransform?: boolean;
|
|
373
|
-
_sitemap?: string;
|
|
373
|
+
_sitemap?: string | false;
|
|
374
374
|
}
|
|
375
375
|
export type SitemapStrict = Required<SitemapUrl>;
|
|
376
376
|
export interface AlternativeEntry {
|
|
@@ -44,6 +44,7 @@ function parseHtmlExtractSitemapMeta(html, options) {
|
|
|
44
44
|
const videoSources = /* @__PURE__ */ new Map();
|
|
45
45
|
let articleModifiedTime;
|
|
46
46
|
const alternatives = [];
|
|
47
|
+
let isBlocked = false;
|
|
47
48
|
walkSync(doc, (node) => {
|
|
48
49
|
if (node.type === ELEMENT_NODE) {
|
|
49
50
|
const element = node;
|
|
@@ -51,6 +52,13 @@ function parseHtmlExtractSitemapMeta(html, options) {
|
|
|
51
52
|
if (element.name === "main" && !mainElement) {
|
|
52
53
|
mainElement = element;
|
|
53
54
|
}
|
|
55
|
+
if (element.name === "meta") {
|
|
56
|
+
const name = sanitizeString(attrs.name).toLowerCase();
|
|
57
|
+
const content = sanitizeString(attrs.content).toLowerCase();
|
|
58
|
+
if (name === "robots" && (content.includes("noindex") || content.includes("none"))) {
|
|
59
|
+
isBlocked = true;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
54
62
|
if (options?.lastmod && element.name === "meta") {
|
|
55
63
|
const property = sanitizeString(attrs.property);
|
|
56
64
|
const content = sanitizeString(attrs.content);
|
|
@@ -203,9 +211,12 @@ function parseHtmlExtractSitemapMeta(html, options) {
|
|
|
203
211
|
if (options?.lastmod && articleModifiedTime) {
|
|
204
212
|
payload.lastmod = articleModifiedTime;
|
|
205
213
|
}
|
|
206
|
-
if (options?.alternatives && alternatives.length > 0 && (alternatives.length > 1 || alternatives[0]
|
|
214
|
+
if (options?.alternatives && alternatives.length > 0 && (alternatives.length > 1 || alternatives[0]?.hreflang !== "x-default")) {
|
|
207
215
|
payload.alternatives = alternatives;
|
|
208
216
|
}
|
|
217
|
+
if (isBlocked) {
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
209
220
|
return payload;
|
|
210
221
|
}
|
|
211
222
|
|
package/dist/utils.d.mts
CHANGED
|
@@ -22,7 +22,7 @@ declare function parseHtmlExtractSitemapMeta(html: string, options?: {
|
|
|
22
22
|
lastmod?: boolean;
|
|
23
23
|
alternatives?: boolean;
|
|
24
24
|
resolveUrl?: (s: string) => string;
|
|
25
|
-
}): Partial<SitemapUrl
|
|
25
|
+
}): Partial<SitemapUrl> | null;
|
|
26
26
|
|
|
27
27
|
export { parseHtmlExtractSitemapMeta, parseSitemapXml };
|
|
28
28
|
export type { SitemapParseResult, SitemapWarning };
|
package/dist/utils.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ declare function parseHtmlExtractSitemapMeta(html: string, options?: {
|
|
|
22
22
|
lastmod?: boolean;
|
|
23
23
|
alternatives?: boolean;
|
|
24
24
|
resolveUrl?: (s: string) => string;
|
|
25
|
-
}): Partial<SitemapUrl
|
|
25
|
+
}): Partial<SitemapUrl> | null;
|
|
26
26
|
|
|
27
27
|
export { parseHtmlExtractSitemapMeta, parseSitemapXml };
|
|
28
28
|
export type { SitemapParseResult, SitemapWarning };
|
package/dist/utils.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxtjs/sitemap",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.4.
|
|
4
|
+
"version": "7.4.8",
|
|
5
5
|
"description": "Powerfully flexible XML Sitemaps that integrate seamlessly, for Nuxt.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -48,44 +48,44 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@nuxt/devtools-kit": "^
|
|
52
|
-
"@nuxt/kit": "^4.1
|
|
51
|
+
"@nuxt/devtools-kit": "^3.1.1",
|
|
52
|
+
"@nuxt/kit": "^4.2.1",
|
|
53
53
|
"chalk": "^5.6.2",
|
|
54
54
|
"defu": "^6.1.4",
|
|
55
|
-
"fast-xml-parser": "^5.2
|
|
55
|
+
"fast-xml-parser": "^5.3.2",
|
|
56
56
|
"h3-compression": "^0.3.2",
|
|
57
|
-
"nuxt-site-config": "^3.2.
|
|
58
|
-
"ofetch": "^1.
|
|
57
|
+
"nuxt-site-config": "^3.2.11",
|
|
58
|
+
"ofetch": "^1.5.1",
|
|
59
59
|
"pathe": "^2.0.3",
|
|
60
60
|
"pkg-types": "^2.3.0",
|
|
61
61
|
"radix3": "^1.1.2",
|
|
62
|
-
"semver": "^7.7.
|
|
62
|
+
"semver": "^7.7.3",
|
|
63
63
|
"sirv": "^3.0.2",
|
|
64
|
-
"std-env": "^3.
|
|
64
|
+
"std-env": "^3.10.0",
|
|
65
65
|
"ufo": "^1.6.1",
|
|
66
66
|
"ultrahtml": "^1.6.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
70
|
-
"@nuxt/content": "^3.
|
|
71
|
-
"@nuxt/eslint-config": "^1.
|
|
70
|
+
"@nuxt/content": "^3.9.0",
|
|
71
|
+
"@nuxt/eslint-config": "^1.11.0",
|
|
72
72
|
"@nuxt/module-builder": "^1.0.2",
|
|
73
|
-
"@nuxt/test-utils": "^3.
|
|
74
|
-
"@nuxt/ui": "^
|
|
75
|
-
"@nuxtjs/i18n": "^10.1
|
|
76
|
-
"@nuxtjs/robots": "^5.
|
|
77
|
-
"better-sqlite3": "^12.
|
|
78
|
-
"bumpp": "^10.2
|
|
79
|
-
"eslint": "^9.
|
|
80
|
-
"eslint-plugin-n": "^17.23.
|
|
81
|
-
"execa": "^9.6.
|
|
82
|
-
"happy-dom": "^
|
|
83
|
-
"nuxt": "^4.1
|
|
84
|
-
"nuxt-i18n-micro": "^
|
|
85
|
-
"typescript": "^5.9.
|
|
73
|
+
"@nuxt/test-utils": "^3.21.0",
|
|
74
|
+
"@nuxt/ui": "^4.2.1",
|
|
75
|
+
"@nuxtjs/i18n": "^10.2.1",
|
|
76
|
+
"@nuxtjs/robots": "^5.6.0",
|
|
77
|
+
"better-sqlite3": "^12.5.0",
|
|
78
|
+
"bumpp": "^10.3.2",
|
|
79
|
+
"eslint": "^9.39.1",
|
|
80
|
+
"eslint-plugin-n": "^17.23.1",
|
|
81
|
+
"execa": "^9.6.1",
|
|
82
|
+
"happy-dom": "^20.0.11",
|
|
83
|
+
"nuxt": "^4.2.1",
|
|
84
|
+
"nuxt-i18n-micro": "^2.13.0",
|
|
85
|
+
"typescript": "^5.9.3",
|
|
86
86
|
"vitest": "^3.2.4",
|
|
87
|
-
"vue-tsc": "^3.
|
|
88
|
-
"@nuxtjs/sitemap": "7.4.
|
|
87
|
+
"vue-tsc": "^3.1.5",
|
|
88
|
+
"@nuxtjs/sitemap": "7.4.8"
|
|
89
89
|
},
|
|
90
90
|
"scripts": {
|
|
91
91
|
"lint": "eslint .",
|
package/virtual.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
declare module '#sitemap-virtual/read-sources.mjs' {
|
|
2
|
+
export function readSourcesFromFilesystem(filename: string): Promise<any | null>
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
declare module '#sitemap-virtual/global-sources.mjs' {
|
|
2
6
|
import type { SitemapSourceBase, SitemapSourceResolved } from '#sitemap/types'
|
|
3
7
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as s,u as a,c as i,o as u,a as t,t as n,b as c,w as l,d,e as f}from"#entry";const p={class:"antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide"},m={class:"max-w-520px text-center"},h=["textContent"],b=["textContent"],g=["textContent"],x={class:"flex items-center justify-center w-full"},y={__name:"error-404",props:{appName:{type:String,default:"Nuxt"},statusCode:{type:Number,default:404},statusMessage:{type:String,default:"Page 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(e){const r=e;return a({title:`${r.statusCode} - ${r.statusMessage} | ${r.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:'*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;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;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}h1,h2,p{margin:0}*,:after,:before{--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 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(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: }'}]}),(k,w)=>{const o=f;return u(),i("div",p,[t("div",m,[t("h1",{class:"font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]",textContent:n(e.statusCode)},null,8,h),t("h2",{class:"font-semibold mb-2 sm:text-3xl text-2xl",textContent:n(e.statusMessage)},null,8,b),t("p",{class:"mb-4 px-2 text-[#64748B] text-md",textContent:n(e.description)},null,8,g),t("div",x,[c(o,{to:"/",class:"font-medium hover:text-[#00DC82] text-sm underline underline-offset-3"},{default:l(()=>[d(n(e.backHome),1)]),_:1})])])])}}},C=s(y,[["__scopeId","data-v-70be6602"]]);export{C as default};
|