@nuxtjs/sitemap 7.5.0 → 7.5.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 +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/BZzBMR0a.js +155 -0
- package/dist/client/_nuxt/{CjT5ejtq.js → BcLzIRTJ.js} +1 -1
- package/dist/client/_nuxt/{DBmpb9dG.js → CQIolwG-.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/c9c08595-dc8d-4073-931c-6ba959692bc1.json +1 -0
- package/dist/client/_nuxt/error-404.DKXSOdpM.css +1 -0
- package/dist/client/_nuxt/error-500.rUXo3Kq4.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/runtime/server/sitemap/builder/sitemap.js +16 -13
- package/dist/runtime/server/sitemap/urlset/sources.d.ts +3 -2
- package/dist/runtime/server/sitemap/urlset/sources.js +16 -6
- package/dist/runtime/types.d.ts +1 -1
- package/dist/runtime/utils-pure.d.ts +6 -0
- package/dist/runtime/utils-pure.js +20 -0
- package/package.json +8 -7
- package/dist/client/_nuxt/FE81ed4p.js +0 -155
- package/dist/client/_nuxt/builds/meta/cbb70b0f-de73-410d-92b2-7798fa3dd9b4.json +0 -1
- package/dist/client/_nuxt/error-404.DC9fsYfS.css +0 -1
- package/dist/client/_nuxt/error-500.DPVweS-0.css +0 -1
|
@@ -1 +1 @@
|
|
|
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"./
|
|
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"./BZzBMR0a.js";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-f52c008b"]]);export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as o,u as s,c as a,o as i,a as t,t as r}from"./
|
|
1
|
+
import{_ as o,u as s,c as a,o as i,a as t,t as r}from"./BZzBMR0a.js";const u={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"},l={class:"max-w-520px text-center"},c=["textContent"],d=["textContent"],p=["textContent"],f={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Internal server error"},description:{type:String,default:"This page is temporarily unavailable."},refresh:{type:String,default:"Refresh this page"}},setup(e){const n=e;return s({title:`${n.statusCode} - ${n.statusMessage} | ${n.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}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: }'}]}),(g,h)=>(i(),a("div",u,[t("div",l,[t("h1",{class:"font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]",textContent:r(e.statusCode)},null,8,c),t("h2",{class:"font-semibold mb-2 sm:text-3xl text-2xl",textContent:r(e.statusMessage)},null,8,d),t("p",{class:"mb-4 px-2 text-[#64748B] text-md",textContent:r(e.description)},null,8,p)])]))}},b=o(f,[["__scopeId","data-v-de2a56d3"]]);export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"c9c08595-dc8d-4073-931c-6ba959692bc1","timestamp":1767659680634}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"c9c08595-dc8d-4073-931c-6ba959692bc1","timestamp":1767659680634,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.grid[data-v-f52c008b]{display:grid}.mb-2[data-v-f52c008b]{margin-bottom:.5rem}.mb-4[data-v-f52c008b]{margin-bottom:1rem}.max-w-520px[data-v-f52c008b]{max-width:520px}.min-h-screen[data-v-f52c008b]{min-height:100vh}.w-full[data-v-f52c008b]{width:100%}.flex[data-v-f52c008b]{display:flex}.place-content-center[data-v-f52c008b]{place-content:center}.items-center[data-v-f52c008b]{align-items:center}.justify-center[data-v-f52c008b]{justify-content:center}.overflow-hidden[data-v-f52c008b]{overflow:hidden}.bg-white[data-v-f52c008b]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-2[data-v-f52c008b]{padding-left:.5rem;padding-right:.5rem}.text-center[data-v-f52c008b]{text-align:center}.text-\[80px\][data-v-f52c008b]{font-size:80px}.text-2xl[data-v-f52c008b]{font-size:1.5rem;line-height:2rem}.text-sm[data-v-f52c008b]{font-size:.875rem;line-height:1.25rem}.text-\[\#020420\][data-v-f52c008b]{--un-text-opacity:1;color:rgb(2 4 32/var(--un-text-opacity))}.text-\[\#64748B\][data-v-f52c008b]{--un-text-opacity:1;color:rgb(100 116 139/var(--un-text-opacity))}.hover\:text-\[\#00DC82\][data-v-f52c008b]:hover{--un-text-opacity:1;color:rgb(0 220 130/var(--un-text-opacity))}.font-medium[data-v-f52c008b]{font-weight:500}.font-semibold[data-v-f52c008b]{font-weight:600}.leading-none[data-v-f52c008b]{line-height:1}.tracking-wide[data-v-f52c008b]{letter-spacing:.025em}.font-sans[data-v-f52c008b]{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}.tabular-nums[data-v-f52c008b]{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)}.underline[data-v-f52c008b]{text-decoration-line:underline}.underline-offset-3[data-v-f52c008b]{text-underline-offset:3px}.antialiased[data-v-f52c008b]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(prefers-color-scheme:dark){.dark\:bg-\[\#020420\][data-v-f52c008b]{--un-bg-opacity:1;background-color:rgb(2 4 32/var(--un-bg-opacity))}.dark\:text-white[data-v-f52c008b]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media(min-width:640px){.sm\:text-\[110px\][data-v-f52c008b]{font-size:110px}.sm\:text-3xl[data-v-f52c008b]{font-size:1.875rem;line-height:2.25rem}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.grid[data-v-de2a56d3]{display:grid}.mb-2[data-v-de2a56d3]{margin-bottom:.5rem}.mb-4[data-v-de2a56d3]{margin-bottom:1rem}.max-w-520px[data-v-de2a56d3]{max-width:520px}.min-h-screen[data-v-de2a56d3]{min-height:100vh}.place-content-center[data-v-de2a56d3]{place-content:center}.overflow-hidden[data-v-de2a56d3]{overflow:hidden}.bg-white[data-v-de2a56d3]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-2[data-v-de2a56d3]{padding-left:.5rem;padding-right:.5rem}.text-center[data-v-de2a56d3]{text-align:center}.text-\[80px\][data-v-de2a56d3]{font-size:80px}.text-2xl[data-v-de2a56d3]{font-size:1.5rem;line-height:2rem}.text-\[\#020420\][data-v-de2a56d3]{--un-text-opacity:1;color:rgb(2 4 32/var(--un-text-opacity))}.text-\[\#64748B\][data-v-de2a56d3]{--un-text-opacity:1;color:rgb(100 116 139/var(--un-text-opacity))}.font-semibold[data-v-de2a56d3]{font-weight:600}.leading-none[data-v-de2a56d3]{line-height:1}.tracking-wide[data-v-de2a56d3]{letter-spacing:.025em}.font-sans[data-v-de2a56d3]{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}.tabular-nums[data-v-de2a56d3]{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)}.antialiased[data-v-de2a56d3]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(prefers-color-scheme:dark){.dark\:bg-\[\#020420\][data-v-de2a56d3]{--un-bg-opacity:1;background-color:rgb(2 4 32/var(--un-bg-opacity))}.dark\:text-white[data-v-de2a56d3]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media(min-width:640px){.sm\:text-\[110px\][data-v-de2a56d3]{font-size:110px}.sm\:text-3xl[data-v-de2a56d3]{font-size:1.875rem;line-height:2.25rem}}
|
package/dist/client/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__sitemap__/devtools/_nuxt/entry.Ci1pP-eR.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__sitemap__/devtools/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__sitemap__/devtools/_nuxt/entry.Ci1pP-eR.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__sitemap__/devtools/_nuxt/BZzBMR0a.js"><script type="module" src="/__sitemap__/devtools/_nuxt/BZzBMR0a.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT_SITE_CONFIG__={_priority:{name:-10,env:-15},env:"production",name:"@nuxtjs\u002Fsitemap-client"}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1767659687075,false]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__sitemap__/devtools",buildId:"c9c08595-dc8d-4073-931c-6ba959692bc1",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/client/sitemap.xml
CHANGED
package/dist/module.json
CHANGED
|
@@ -3,12 +3,8 @@ import { joinURL, withHttps } from "ufo";
|
|
|
3
3
|
import { preNormalizeEntry } from "../urlset/normalise.js";
|
|
4
4
|
import { childSitemapSources, globalSitemapSources, resolveSitemapSources } from "../urlset/sources.js";
|
|
5
5
|
import { sortInPlace } from "../urlset/sort.js";
|
|
6
|
-
import { createPathFilter, splitForLocales } from "../../../utils-pure.js";
|
|
6
|
+
import { applyDynamicParams, createPathFilter, findPageMapping, splitForLocales } from "../../../utils-pure.js";
|
|
7
7
|
import { parseChunkInfo, sliceUrlsForChunk } from "../utils/chunk.js";
|
|
8
|
-
function getPageKey(pathWithoutPrefix) {
|
|
9
|
-
const stripped = pathWithoutPrefix[0] === "/" ? pathWithoutPrefix.slice(1) : pathWithoutPrefix;
|
|
10
|
-
return stripped.endsWith("/index") ? stripped.slice(0, -6) || "index" : stripped || "index";
|
|
11
|
-
}
|
|
12
8
|
export function resolveSitemapEntries(sitemap, urls, runtimeConfig, resolvers) {
|
|
13
9
|
const {
|
|
14
10
|
autoI18n,
|
|
@@ -91,18 +87,21 @@ export function resolveSitemapEntries(sitemap, urls, runtimeConfig, resolvers) {
|
|
|
91
87
|
};
|
|
92
88
|
});
|
|
93
89
|
} else {
|
|
94
|
-
const
|
|
95
|
-
const pageMappings = hasPages ? autoI18n.pages[pageKey] : void 0;
|
|
90
|
+
const pageMatch = hasPages ? findPageMapping(e._pathWithoutPrefix, autoI18n.pages) : null;
|
|
96
91
|
const pathSearch = e._path?.search || "";
|
|
97
92
|
const pathWithoutPrefix = e._pathWithoutPrefix;
|
|
98
93
|
for (const l of autoI18n.locales) {
|
|
99
94
|
let loc = pathWithoutPrefix;
|
|
100
|
-
if (
|
|
101
|
-
const customPath =
|
|
95
|
+
if (pageMatch && pageMatch.mappings[l.code] !== void 0) {
|
|
96
|
+
const customPath = pageMatch.mappings[l.code];
|
|
102
97
|
if (customPath === false)
|
|
103
98
|
continue;
|
|
104
|
-
if (typeof customPath === "string")
|
|
99
|
+
if (typeof customPath === "string") {
|
|
105
100
|
loc = customPath[0] === "/" ? customPath : `/${customPath}`;
|
|
101
|
+
loc = applyDynamicParams(loc, pageMatch.paramSegments);
|
|
102
|
+
if (isPrefixStrategy || isPrefixExceptOrAndDefault && l.code !== defaultLocale)
|
|
103
|
+
loc = joinURL(`/${l.code}`, loc);
|
|
104
|
+
}
|
|
106
105
|
} else if (!hasDifferentDomains && !(isPrefixExceptOrAndDefault && l.code === defaultLocale)) {
|
|
107
106
|
loc = joinURL(`/${l.code}`, pathWithoutPrefix);
|
|
108
107
|
}
|
|
@@ -112,12 +111,16 @@ export function resolveSitemapEntries(sitemap, urls, runtimeConfig, resolvers) {
|
|
|
112
111
|
const code = locale.code === "x-default" ? defaultLocale : locale.code;
|
|
113
112
|
const isDefault = locale.code === "x-default" || locale.code === defaultLocale;
|
|
114
113
|
let href = pathWithoutPrefix;
|
|
115
|
-
if (
|
|
116
|
-
const customPath =
|
|
114
|
+
if (pageMatch && pageMatch.mappings[code] !== void 0) {
|
|
115
|
+
const customPath = pageMatch.mappings[code];
|
|
117
116
|
if (customPath === false)
|
|
118
117
|
continue;
|
|
119
|
-
if (typeof customPath === "string")
|
|
118
|
+
if (typeof customPath === "string") {
|
|
120
119
|
href = customPath[0] === "/" ? customPath : `/${customPath}`;
|
|
120
|
+
href = applyDynamicParams(href, pageMatch.paramSegments);
|
|
121
|
+
if (isPrefixStrategy || isPrefixExceptOrAndDefault && !isDefault)
|
|
122
|
+
href = joinURL("/", code, href);
|
|
123
|
+
}
|
|
121
124
|
} else if (isPrefixStrategy) {
|
|
122
125
|
href = joinURL("/", code, pathWithoutPrefix);
|
|
123
126
|
} else if (isPrefixExceptOrAndDefault && !isDefault) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { H3Event } from 'h3';
|
|
2
|
-
import type { ModuleRuntimeConfig, SitemapSourceBase, SitemapSourceResolved } from '../../../types.js';
|
|
2
|
+
import type { ModuleRuntimeConfig, SitemapSourceBase, SitemapSourceInput, SitemapSourceResolved } from '../../../types.js';
|
|
3
|
+
export declare function normalizeSourceInput(source: SitemapSourceInput): SitemapSourceBase | SitemapSourceResolved;
|
|
3
4
|
export declare function fetchDataSource(input: SitemapSourceBase | SitemapSourceResolved, event?: H3Event): Promise<SitemapSourceResolved>;
|
|
4
5
|
export declare function globalSitemapSources(): Promise<any[]>;
|
|
5
6
|
export declare function childSitemapSources(definition: ModuleRuntimeConfig['sitemaps'][string]): Promise<any[]>;
|
|
6
|
-
export declare function resolveSitemapSources(sources:
|
|
7
|
+
export declare function resolveSitemapSources(sources: SitemapSourceInput[], event?: H3Event): Promise<SitemapSourceResolved[]>;
|
|
@@ -3,6 +3,15 @@ import { defu } from "defu";
|
|
|
3
3
|
import { parseURL } from "ufo";
|
|
4
4
|
import { logger } from "../../../utils-pure.js";
|
|
5
5
|
import { parseSitemapXml } from "@nuxtjs/sitemap/utils";
|
|
6
|
+
export function normalizeSourceInput(source) {
|
|
7
|
+
if (typeof source === "string") {
|
|
8
|
+
return { context: { name: "hook" }, fetch: source };
|
|
9
|
+
}
|
|
10
|
+
if (Array.isArray(source)) {
|
|
11
|
+
return { context: { name: "hook" }, fetch: source };
|
|
12
|
+
}
|
|
13
|
+
return source;
|
|
14
|
+
}
|
|
6
15
|
async function tryFetchWithFallback(url, options, event) {
|
|
7
16
|
const isExternalUrl = !url.startsWith("/");
|
|
8
17
|
if (isExternalUrl) {
|
|
@@ -143,17 +152,18 @@ export async function childSitemapSources(definition) {
|
|
|
143
152
|
export async function resolveSitemapSources(sources, event) {
|
|
144
153
|
return (await Promise.all(
|
|
145
154
|
sources.map((source) => {
|
|
146
|
-
|
|
155
|
+
const normalized = normalizeSourceInput(source);
|
|
156
|
+
if ("urls" in normalized) {
|
|
147
157
|
return {
|
|
148
158
|
timeTakenMs: 0,
|
|
149
|
-
...
|
|
150
|
-
urls:
|
|
159
|
+
...normalized,
|
|
160
|
+
urls: normalized.urls
|
|
151
161
|
};
|
|
152
162
|
}
|
|
153
|
-
if (
|
|
154
|
-
return fetchDataSource(
|
|
163
|
+
if (normalized.fetch)
|
|
164
|
+
return fetchDataSource(normalized, event);
|
|
155
165
|
return {
|
|
156
|
-
...
|
|
166
|
+
...normalized,
|
|
157
167
|
error: "Invalid source"
|
|
158
168
|
};
|
|
159
169
|
})
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -366,7 +366,7 @@ export interface SitemapOutputHookCtx extends NitroBaseHook {
|
|
|
366
366
|
}
|
|
367
367
|
export interface SitemapSourcesHookCtx extends NitroBaseHook {
|
|
368
368
|
sitemapName: string;
|
|
369
|
-
sources:
|
|
369
|
+
sources: SitemapSourceInput[];
|
|
370
370
|
}
|
|
371
371
|
export type Changefreq = 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never';
|
|
372
372
|
export interface SitemapUrl {
|
|
@@ -11,4 +11,10 @@ export interface CreateFilterOptions {
|
|
|
11
11
|
exclude?: (FilterInput | string | RegExp)[];
|
|
12
12
|
}
|
|
13
13
|
export declare function createPathFilter(options?: CreateFilterOptions): (loc: string) => boolean;
|
|
14
|
+
export interface PageMatch {
|
|
15
|
+
mappings: Record<string, string | false>;
|
|
16
|
+
paramSegments: string[];
|
|
17
|
+
}
|
|
18
|
+
export declare function findPageMapping(pathWithoutPrefix: string, pages: Record<string, Record<string, string | false>>): PageMatch | null;
|
|
19
|
+
export declare function applyDynamicParams(customPath: string, paramSegments: string[]): string;
|
|
14
20
|
export declare function createFilter(options?: CreateFilterOptions): (path: string) => boolean;
|
|
@@ -58,6 +58,26 @@ export function createPathFilter(options = {}) {
|
|
|
58
58
|
return urlFilter(path);
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
+
export function findPageMapping(pathWithoutPrefix, pages) {
|
|
62
|
+
const stripped = pathWithoutPrefix[0] === "/" ? pathWithoutPrefix.slice(1) : pathWithoutPrefix;
|
|
63
|
+
const pageKey = stripped.endsWith("/index") ? stripped.slice(0, -6) || "index" : stripped || "index";
|
|
64
|
+
if (pages[pageKey])
|
|
65
|
+
return { mappings: pages[pageKey], paramSegments: [] };
|
|
66
|
+
const sortedKeys = Object.keys(pages).sort((a, b) => b.length - a.length);
|
|
67
|
+
for (const key of sortedKeys) {
|
|
68
|
+
if (pageKey.startsWith(key + "/")) {
|
|
69
|
+
const paramPath = pageKey.slice(key.length + 1);
|
|
70
|
+
return { mappings: pages[key], paramSegments: paramPath.split("/") };
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
export function applyDynamicParams(customPath, paramSegments) {
|
|
76
|
+
if (!paramSegments.length)
|
|
77
|
+
return customPath;
|
|
78
|
+
let i = 0;
|
|
79
|
+
return customPath.replace(/\[[^\]]+\]/g, () => paramSegments[i++] || "");
|
|
80
|
+
}
|
|
61
81
|
export function createFilter(options = {}) {
|
|
62
82
|
const include = options.include || [];
|
|
63
83
|
const exclude = options.exclude || [];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxtjs/sitemap",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.5.
|
|
4
|
+
"version": "7.5.1",
|
|
5
5
|
"description": "Powerfully flexible XML Sitemaps that integrate seamlessly, for Nuxt.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -75,13 +75,14 @@
|
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
78
|
-
"@nuxt/content": "^3.
|
|
78
|
+
"@nuxt/content": "^3.10.0",
|
|
79
79
|
"@nuxt/eslint-config": "^1.12.1",
|
|
80
80
|
"@nuxt/module-builder": "^1.0.2",
|
|
81
|
-
"@nuxt/test-utils": "^3.
|
|
82
|
-
"@nuxt/ui": "^4.
|
|
81
|
+
"@nuxt/test-utils": "^3.22.0",
|
|
82
|
+
"@nuxt/ui": "^4.3.0",
|
|
83
83
|
"@nuxtjs/i18n": "^10.2.1",
|
|
84
84
|
"@nuxtjs/robots": "^5.6.7",
|
|
85
|
+
"@vue/test-utils": "^2.4.6",
|
|
85
86
|
"better-sqlite3": "^12.5.0",
|
|
86
87
|
"bumpp": "^10.3.2",
|
|
87
88
|
"eslint": "^9.39.2",
|
|
@@ -89,11 +90,11 @@
|
|
|
89
90
|
"execa": "^9.6.1",
|
|
90
91
|
"happy-dom": "^20.0.11",
|
|
91
92
|
"nuxt": "^4.2.2",
|
|
92
|
-
"nuxt-i18n-micro": "^2.
|
|
93
|
+
"nuxt-i18n-micro": "^2.16.3",
|
|
93
94
|
"typescript": "^5.9.3",
|
|
94
95
|
"vitest": "3.2.4",
|
|
95
|
-
"vue-tsc": "^3.
|
|
96
|
-
"@nuxtjs/sitemap": "7.5.
|
|
96
|
+
"vue-tsc": "^3.2.2",
|
|
97
|
+
"@nuxtjs/sitemap": "7.5.1"
|
|
97
98
|
},
|
|
98
99
|
"scripts": {
|
|
99
100
|
"lint": "eslint .",
|