@nuxtjs/sitemap 5.2.0 → 5.2.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.
- package/dist/client/200.html +24 -25
- package/dist/client/404.html +24 -25
- package/dist/client/_nuxt/{hm-j440x.js → BC6uB4eG.js} +1 -1
- package/dist/client/_nuxt/BGZ4JUW7.js +31 -0
- package/dist/client/_nuxt/BJn7Ek5W.js +1 -0
- package/dist/client/_nuxt/BT6Hj2kT.js +1 -0
- package/dist/client/_nuxt/{o5b8QYQO.js → Bfj2ThZ4.js} +1 -1
- package/dist/client/_nuxt/{D6NljDpC.js → BigF1UXR.js} +1 -1
- package/dist/client/_nuxt/Bj0fF4lQ.js +1 -0
- package/dist/client/_nuxt/{DGMFlOLs.js → BmSZh3NL.js} +1 -1
- package/dist/client/_nuxt/BnWyG0Yo.js +1 -0
- package/dist/client/_nuxt/BvCdDh2R.js +1 -0
- package/dist/client/_nuxt/{wwwLBkz3.js → CL-qhHZf.js} +1 -1
- package/dist/client/_nuxt/CZ99H4LZ.js +1 -0
- package/dist/client/_nuxt/{B5NHDIr7.js → Cp2HGa90.js} +2 -2
- package/dist/client/_nuxt/DAP_O-zg.js +1 -0
- package/dist/client/_nuxt/{B4ACM-c0.js → DCjyzNN-.js} +1 -1
- package/dist/client/_nuxt/{DKlGn9uv.js → DGEpfOTx.js} +1 -1
- package/dist/client/_nuxt/DOHBU7tp.js +1 -0
- package/dist/client/_nuxt/Dd6f7Z5P.js +1 -0
- package/dist/client/_nuxt/Icon.BhjmZGan.css +1 -0
- package/dist/client/_nuxt/IconCSS.BPON9v2Q.css +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/db4ce94a-4eca-43d4-b5fb-da1dfa0d2a79.json +1 -0
- package/dist/client/_nuxt/entry.CmimZAHN.css +1 -0
- package/dist/client/_nuxt/error-404.C7lYlUVC.css +1 -0
- package/dist/client/_nuxt/error-500.f8GAwExH.css +1 -0
- package/dist/client/_nuxt/{BcF9sHHc.js → o8H-iTt6.js} +2 -2
- package/dist/client/_nuxt/xtV5iK4E.js +1 -0
- package/dist/client/_nuxt/{P5f3PASf.js → zhgf4ixb.js} +1 -1
- package/dist/client/index.html +24 -25
- package/dist/module.d.mts +1 -332
- package/dist/module.d.ts +1 -332
- package/dist/module.json +6 -2
- package/dist/module.mjs +6 -96
- package/dist/runtime/nitro/composables/asSitemapUrl.d.ts +1 -1
- package/dist/runtime/nitro/composables/defineSitemapEventHandler.d.ts +1 -1
- package/dist/runtime/nitro/middleware/{[sitemap]-sitemap.xml.mjs → [sitemap]-sitemap.xml.js} +2 -2
- package/dist/runtime/nitro/plugins/{nuxt-content.mjs → nuxt-content.js} +1 -1
- package/dist/runtime/nitro/plugins/{warm-up.mjs → warm-up.js} +1 -1
- package/dist/runtime/nitro/routes/__sitemap__/debug.d.ts +2 -2
- package/dist/runtime/nitro/routes/__sitemap__/{debug.mjs → debug.js} +2 -2
- package/dist/runtime/nitro/routes/{sitemap.xml.mjs → sitemap.xml.js} +2 -2
- package/dist/runtime/nitro/routes/{sitemap.xsl.mjs → sitemap.xsl.js} +1 -1
- package/dist/runtime/nitro/routes/{sitemap_index.xml.mjs → sitemap_index.xml.js} +2 -2
- package/dist/runtime/nitro/sitemap/builder/sitemap-index.d.ts +1 -1
- package/dist/runtime/nitro/sitemap/builder/{sitemap-index.mjs → sitemap-index.js} +6 -6
- package/dist/runtime/nitro/sitemap/builder/sitemap.d.ts +1 -1
- package/dist/runtime/nitro/sitemap/builder/{sitemap.mjs → sitemap.js} +8 -8
- package/dist/runtime/nitro/sitemap/builder/xml.d.ts +1 -1
- package/dist/runtime/nitro/sitemap/nitro.d.ts +1 -1
- package/dist/runtime/nitro/sitemap/{nitro.mjs → nitro.js} +2 -2
- package/dist/runtime/nitro/sitemap/urlset/filter.d.ts +1 -1
- package/dist/runtime/nitro/sitemap/urlset/{filter.mjs → filter.js} +1 -1
- package/dist/runtime/nitro/sitemap/urlset/i18n.d.ts +1 -1
- package/dist/runtime/nitro/sitemap/urlset/{i18n.mjs → i18n.js} +1 -1
- package/dist/runtime/nitro/sitemap/urlset/normalise.d.ts +1 -1
- package/dist/runtime/nitro/sitemap/urlset/{normalise.mjs → normalise.js} +1 -1
- package/dist/runtime/nitro/sitemap/urlset/sort.d.ts +1 -1
- package/dist/runtime/nitro/sitemap/urlset/sources.d.ts +1 -1
- package/dist/runtime/nitro/utils.d.ts +2 -2
- package/dist/runtime/nitro/{utils.mjs → utils.js} +2 -2
- package/dist/runtime/utils-pure.d.ts +1 -1
- package/dist/types.d.mts +2 -9
- package/dist/types.d.ts +2 -9
- package/package.json +15 -15
- package/dist/client/_nuxt/4id9yZy9.js +0 -1
- package/dist/client/_nuxt/5gXNyPeq.js +0 -1
- package/dist/client/_nuxt/B6ZnTe72.js +0 -1
- package/dist/client/_nuxt/BAMIS8DD.js +0 -1
- package/dist/client/_nuxt/BLD-YeUO.js +0 -36
- package/dist/client/_nuxt/Bsp1M94H.js +0 -1
- package/dist/client/_nuxt/Bx89rGXK.js +0 -1
- package/dist/client/_nuxt/C9UBdavN.js +0 -1
- package/dist/client/_nuxt/D8ltPvRq.js +0 -1
- package/dist/client/_nuxt/Db2-y2xY.js +0 -1
- package/dist/client/_nuxt/Dz2Ca8U2.js +0 -1
- package/dist/client/_nuxt/Icon.CBNAyDNE.css +0 -1
- package/dist/client/_nuxt/IconCSS.BjWhc-VD.css +0 -1
- package/dist/client/_nuxt/builds/meta/eed887b5-8cf6-4ae2-9094-c95111b61a41.json +0 -1
- package/dist/client/_nuxt/entry.BFped8KZ.css +0 -1
- package/dist/client/_nuxt/error-404.BRldFSII.css +0 -1
- package/dist/client/_nuxt/error-500.D8yw_IbC.css +0 -1
- /package/dist/runtime/nitro/composables/{asSitemapUrl.mjs → asSitemapUrl.js} +0 -0
- /package/dist/runtime/nitro/composables/{defineSitemapEventHandler.mjs → defineSitemapEventHandler.js} +0 -0
- /package/dist/runtime/nitro/composables/{getPathRobotConfigPolyfill.mjs → getPathRobotConfigPolyfill.js} +0 -0
- /package/dist/runtime/nitro/{kit.mjs → kit.js} +0 -0
- /package/dist/runtime/nitro/plugins/{compression.mjs → compression.js} +0 -0
- /package/dist/runtime/nitro/routes/__sitemap__/{nuxt-content-urls.mjs → nuxt-content-urls.js} +0 -0
- /package/dist/runtime/nitro/sitemap/builder/{xml.mjs → xml.js} +0 -0
- /package/dist/runtime/nitro/sitemap/urlset/{sort.mjs → sort.js} +0 -0
- /package/dist/runtime/nitro/sitemap/urlset/{sources.mjs → sources.js} +0 -0
- /package/dist/runtime/{types.mjs → types.js} +0 -0
- /package/dist/runtime/{utils-pure.mjs → utils-pure.js} +0 -0
package/dist/module.d.ts
CHANGED
|
@@ -1,336 +1,5 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
interface ModuleOptions$1 extends SitemapDefinition {
|
|
5
|
-
/**
|
|
6
|
-
* Whether the sitemap.xml should be generated.
|
|
7
|
-
*
|
|
8
|
-
* @default true
|
|
9
|
-
*/
|
|
10
|
-
enabled: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Enables debug logs and a debug endpoint.
|
|
13
|
-
*
|
|
14
|
-
* @default false
|
|
15
|
-
*/
|
|
16
|
-
debug: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Should lastmod be automatically added to the sitemap.
|
|
19
|
-
*
|
|
20
|
-
* Warning: This may not be following best practices for sitemaps.
|
|
21
|
-
*
|
|
22
|
-
* @see https://nuxtseo.com/sitemap/guides/best-practices.
|
|
23
|
-
* @default false
|
|
24
|
-
*/
|
|
25
|
-
autoLastmod: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Should pages be automatically added to the sitemap.
|
|
28
|
-
*
|
|
29
|
-
* @default true
|
|
30
|
-
* @deprecated If set to false, use `excludeAppSources: ['pages', 'route-rules', 'prerender']` instead. Otherwise, remove this.
|
|
31
|
-
*/
|
|
32
|
-
inferStaticPagesAsRoutes: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Sources to exclude from the sitemap.
|
|
35
|
-
*/
|
|
36
|
-
excludeAppSources: true | (AppSourceContext[]);
|
|
37
|
-
/**
|
|
38
|
-
* Multiple sitemap support for large sites.
|
|
39
|
-
*
|
|
40
|
-
* @default false
|
|
41
|
-
*/
|
|
42
|
-
sitemaps?: boolean | MultiSitemapsInput;
|
|
43
|
-
/**
|
|
44
|
-
* Sitemaps to append to the sitemap index.
|
|
45
|
-
*
|
|
46
|
-
* This will only do anything when using multiple sitemaps.
|
|
47
|
-
*/
|
|
48
|
-
appendSitemaps?: (string | SitemapIndexEntry)[];
|
|
49
|
-
/**
|
|
50
|
-
* Path to the xsl that styles sitemap.xml.
|
|
51
|
-
*
|
|
52
|
-
* Set to `false` to disable styling.
|
|
53
|
-
*
|
|
54
|
-
* @default /__sitemap__/style.xsl
|
|
55
|
-
*/
|
|
56
|
-
xsl: string | false;
|
|
57
|
-
/**
|
|
58
|
-
* Toggle the tips displayed in the xsl.
|
|
59
|
-
*
|
|
60
|
-
* @default true
|
|
61
|
-
*/
|
|
62
|
-
xslTips: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Customised the columns displayed in the xsl.
|
|
65
|
-
*
|
|
66
|
-
* @default [{ label: 'URL', width: '50%', select: 'string' }, { label: 'Last Modified', width: '25%', select: 'lastmod' }, { label: 'Change Frequency', width: '25%', select: 'changefreq' }]
|
|
67
|
-
*/
|
|
68
|
-
xslColumns?: {
|
|
69
|
-
label: string;
|
|
70
|
-
width: `${string}%`;
|
|
71
|
-
select?: string;
|
|
72
|
-
}[];
|
|
73
|
-
/**
|
|
74
|
-
* When prerendering, should images be automatically be discovered and added to the sitemap.
|
|
75
|
-
*
|
|
76
|
-
* @default true
|
|
77
|
-
*/
|
|
78
|
-
discoverImages: boolean;
|
|
79
|
-
/**
|
|
80
|
-
* When chunking the sitemaps into multiple files, how many entries should each file contain.
|
|
81
|
-
*
|
|
82
|
-
* Set to `false` to disabling chunking completely.
|
|
83
|
-
*
|
|
84
|
-
* @default 1000
|
|
85
|
-
*/
|
|
86
|
-
defaultSitemapsChunkSize: number | false;
|
|
87
|
-
/**
|
|
88
|
-
* Modify the cache behavior.
|
|
89
|
-
*
|
|
90
|
-
* Passing a boolean will enable or disable the runtime cache with the default options.
|
|
91
|
-
*
|
|
92
|
-
* Providing a record will allow you to configure the runtime cache fully.
|
|
93
|
-
*
|
|
94
|
-
* @default true
|
|
95
|
-
* @see https://nitro.unjs.io/guide/storage#mountpoints
|
|
96
|
-
* @example { driver: 'redis', host: 'localhost', port: 6379, password: 'password' }
|
|
97
|
-
*/
|
|
98
|
-
runtimeCacheStorage: boolean | (Record<string, any> & {
|
|
99
|
-
driver: string;
|
|
100
|
-
});
|
|
101
|
-
/**
|
|
102
|
-
* Automatically add alternative links to the sitemap based on a prefix list.
|
|
103
|
-
* Is used by @nuxtjs/i18n to automatically add alternative links to the sitemap.
|
|
104
|
-
*/
|
|
105
|
-
autoI18n?: boolean | AutoI18nConfig;
|
|
106
|
-
/**
|
|
107
|
-
* Enable when your nuxt/content files match your pages. This will automatically add sitemap content to the sitemap.
|
|
108
|
-
*
|
|
109
|
-
* This is similar behavior to using `nuxt/content` with `documentDriven: true`.
|
|
110
|
-
*/
|
|
111
|
-
strictNuxtContentPaths: boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Should the sitemap.xml display credits for the module.
|
|
114
|
-
*
|
|
115
|
-
* @default true
|
|
116
|
-
*/
|
|
117
|
-
credits: boolean;
|
|
118
|
-
/**
|
|
119
|
-
* How long, in milliseconds, should the sitemap be cached for.
|
|
120
|
-
*
|
|
121
|
-
* @default 1 hour
|
|
122
|
-
*
|
|
123
|
-
* @deprecated use cacheMaxAgeSeconds
|
|
124
|
-
*/
|
|
125
|
-
cacheTtl?: number | false;
|
|
126
|
-
/**
|
|
127
|
-
* How long, in seconds, should the sitemap be cached for.
|
|
128
|
-
*
|
|
129
|
-
* @default 600
|
|
130
|
-
*/
|
|
131
|
-
cacheMaxAgeSeconds: number | false;
|
|
132
|
-
/**
|
|
133
|
-
* Should the entries be sorted by loc.
|
|
134
|
-
*
|
|
135
|
-
* @default true
|
|
136
|
-
*/
|
|
137
|
-
sortEntries: boolean;
|
|
138
|
-
/**
|
|
139
|
-
* Warm up the sitemap route(s) cache when Nitro starts.
|
|
140
|
-
*
|
|
141
|
-
* May be implemented by default in a future minor version.
|
|
142
|
-
*
|
|
143
|
-
* @experimental Will be enabled by default in v5 (if stable)
|
|
144
|
-
*/
|
|
145
|
-
experimentalWarmUp?: boolean;
|
|
146
|
-
/**
|
|
147
|
-
* Send the Sitemap as a compressed stream supporting gzip, brolti, etc.
|
|
148
|
-
*
|
|
149
|
-
* @experimental Will be enabled by default in v5 (if stable)
|
|
150
|
-
*/
|
|
151
|
-
experimentalCompression?: boolean;
|
|
152
|
-
}
|
|
153
|
-
interface IndexSitemapRemotes {
|
|
154
|
-
index?: (string | SitemapIndexEntry)[];
|
|
155
|
-
}
|
|
156
|
-
interface MultiSitemapEntry {
|
|
157
|
-
[key: string]: Partial<SitemapDefinition>;
|
|
158
|
-
}
|
|
159
|
-
type MultiSitemapsInput = Partial<MultiSitemapEntry> & Partial<IndexSitemapRemotes>;
|
|
160
|
-
type MaybeFunction<T> = T | (() => T);
|
|
161
|
-
type MaybePromise<T> = T | Promise<T>;
|
|
162
|
-
type SitemapUrlInput = SitemapUrl | string;
|
|
163
|
-
interface SitemapSourceBase {
|
|
164
|
-
context: {
|
|
165
|
-
name: string;
|
|
166
|
-
description?: string;
|
|
167
|
-
tips?: string[];
|
|
168
|
-
};
|
|
169
|
-
fetch?: string | [string, FetchOptions];
|
|
170
|
-
urls?: SitemapUrlInput[];
|
|
171
|
-
sourceType?: 'app' | 'user';
|
|
172
|
-
}
|
|
173
|
-
interface SitemapSourceResolved extends Omit<SitemapSourceBase, 'urls'> {
|
|
174
|
-
urls: SitemapUrlInput[];
|
|
175
|
-
error?: any;
|
|
176
|
-
timeTakenMs?: number;
|
|
177
|
-
}
|
|
178
|
-
type AppSourceContext = 'nuxt:pages' | 'nuxt:prerender' | 'nuxt:route-rules' | '@nuxtjs/i18n:pages' | '@nuxt/content:document-driven';
|
|
179
|
-
type SitemapSourceInput = string | [string, FetchOptions] | SitemapSourceBase | SitemapSourceResolved;
|
|
180
|
-
type NormalisedLocales = {
|
|
181
|
-
code: string;
|
|
182
|
-
iso?: string;
|
|
183
|
-
domain?: string;
|
|
184
|
-
}[];
|
|
185
|
-
interface AutoI18nConfig {
|
|
186
|
-
differentDomains?: boolean;
|
|
187
|
-
locales: NormalisedLocales;
|
|
188
|
-
defaultLocale: string;
|
|
189
|
-
strategy: 'prefix' | 'prefix_except_default' | 'prefix_and_default' | 'no_prefix';
|
|
190
|
-
}
|
|
191
|
-
interface SitemapIndexEntry {
|
|
192
|
-
sitemap: string;
|
|
193
|
-
lastmod?: string;
|
|
194
|
-
}
|
|
195
|
-
type FilterInput = (string | RegExp | {
|
|
196
|
-
regex: string;
|
|
197
|
-
});
|
|
198
|
-
interface SitemapDefinition {
|
|
199
|
-
/**
|
|
200
|
-
* A collection include patterns for filtering which URLs end up in the sitemap.
|
|
201
|
-
*/
|
|
202
|
-
include?: FilterInput[];
|
|
203
|
-
/**
|
|
204
|
-
* A collection exclude patterns for filtering which URLs end up in the sitemap.
|
|
205
|
-
*/
|
|
206
|
-
exclude?: FilterInput[];
|
|
207
|
-
/**
|
|
208
|
-
* Should the sitemap be generated using global sources.
|
|
209
|
-
*
|
|
210
|
-
* This is enabled by default when using a single sitemap. Otherwise, it will be opt-in.
|
|
211
|
-
*/
|
|
212
|
-
includeAppSources?: boolean;
|
|
213
|
-
/**
|
|
214
|
-
* The root sitemap name.
|
|
215
|
-
* Only works when multiple sitemaps option `sitemaps` isn't used.
|
|
216
|
-
*
|
|
217
|
-
* @default `sitemap.xml`
|
|
218
|
-
*/
|
|
219
|
-
sitemapName: string;
|
|
220
|
-
/**
|
|
221
|
-
* A resolvable collection of URLs to include in the sitemap.
|
|
222
|
-
*
|
|
223
|
-
* Will be resolved when the sitemap is generated.
|
|
224
|
-
*/
|
|
225
|
-
urls?: MaybeFunction<MaybePromise<SitemapUrlInput[]>>;
|
|
226
|
-
/**
|
|
227
|
-
* Default options for all URLs in the sitemap.
|
|
228
|
-
*/
|
|
229
|
-
defaults?: Omit<SitemapUrl, 'loc'>;
|
|
230
|
-
/**
|
|
231
|
-
* Additional sources of URLs to include in the sitemap.
|
|
232
|
-
*/
|
|
233
|
-
sources?: SitemapSourceInput[];
|
|
234
|
-
/**
|
|
235
|
-
* The endpoint to fetch dynamic URLs from.
|
|
236
|
-
*
|
|
237
|
-
* @deprecated use `sources`
|
|
238
|
-
*/
|
|
239
|
-
dynamicUrlsApiEndpoint?: string | false;
|
|
240
|
-
/**
|
|
241
|
-
* @internal
|
|
242
|
-
*/
|
|
243
|
-
_route?: string;
|
|
244
|
-
}
|
|
245
|
-
type Changefreq = 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never';
|
|
246
|
-
interface SitemapUrl {
|
|
247
|
-
loc: string;
|
|
248
|
-
lastmod?: string | Date;
|
|
249
|
-
changefreq?: Changefreq;
|
|
250
|
-
priority?: 0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1;
|
|
251
|
-
alternatives?: Array<AlternativeEntry>;
|
|
252
|
-
news?: GoogleNewsEntry;
|
|
253
|
-
images?: Array<ImageEntry>;
|
|
254
|
-
videos?: Array<VideoEntry>;
|
|
255
|
-
_i18nTransform?: boolean;
|
|
256
|
-
_sitemap?: string;
|
|
257
|
-
/**
|
|
258
|
-
* @deprecated use `loc`
|
|
259
|
-
*/
|
|
260
|
-
url?: string;
|
|
261
|
-
}
|
|
262
|
-
interface AlternativeEntry {
|
|
263
|
-
hreflang: string;
|
|
264
|
-
href: string | URL;
|
|
265
|
-
}
|
|
266
|
-
interface GoogleNewsEntry {
|
|
267
|
-
/**
|
|
268
|
-
* The title of the news article.
|
|
269
|
-
* @example "Companies A, B in Merger Talks"
|
|
270
|
-
*/
|
|
271
|
-
title: string;
|
|
272
|
-
/**
|
|
273
|
-
* The article publication date in W3C format. Specify the original date and time when the article was first
|
|
274
|
-
* published on your site. Don't specify the time when you added the article to your sitemap.
|
|
275
|
-
* @example "2008-12-23"
|
|
276
|
-
*/
|
|
277
|
-
publication_date: Date | string;
|
|
278
|
-
publication: {
|
|
279
|
-
/**
|
|
280
|
-
* The <news:name> tag is the name of the news publication.
|
|
281
|
-
* It must exactly match the name as it appears on your articles on news.google.com, omitting anything in parentheses.
|
|
282
|
-
* @example "The Example Times"
|
|
283
|
-
*/
|
|
284
|
-
name: string;
|
|
285
|
-
/**
|
|
286
|
-
* The <news:language> tag is the language of your publication. Use an ISO 639 language code (two or three letters).
|
|
287
|
-
* @example en
|
|
288
|
-
*/
|
|
289
|
-
language: string;
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
interface ImageEntry {
|
|
293
|
-
loc: string | URL;
|
|
294
|
-
caption?: string;
|
|
295
|
-
geoLocation?: string;
|
|
296
|
-
title?: string;
|
|
297
|
-
license?: string | URL;
|
|
298
|
-
}
|
|
299
|
-
interface VideoEntry {
|
|
300
|
-
title: string;
|
|
301
|
-
thumbnail_loc: string | URL;
|
|
302
|
-
description: string;
|
|
303
|
-
content_loc?: string | URL;
|
|
304
|
-
player_loc?: string | URL;
|
|
305
|
-
duration?: number;
|
|
306
|
-
expiration_date?: Date | string;
|
|
307
|
-
rating?: number;
|
|
308
|
-
view_count?: number;
|
|
309
|
-
publication_date?: Date | string;
|
|
310
|
-
family_friendly?: 'yes' | 'no' | boolean;
|
|
311
|
-
restriction?: Restriction;
|
|
312
|
-
platform?: Platform;
|
|
313
|
-
price?: ({
|
|
314
|
-
price?: number | string;
|
|
315
|
-
currency?: string;
|
|
316
|
-
type?: 'rent' | 'purchase' | 'package' | 'subscription';
|
|
317
|
-
})[];
|
|
318
|
-
requires_subscription?: 'yes' | 'no' | boolean;
|
|
319
|
-
uploader?: {
|
|
320
|
-
uploader: string;
|
|
321
|
-
info?: string | URL;
|
|
322
|
-
};
|
|
323
|
-
live?: 'yes' | 'no' | boolean;
|
|
324
|
-
tag?: string | string[];
|
|
325
|
-
}
|
|
326
|
-
interface Restriction {
|
|
327
|
-
relationship: 'allow' | 'deny';
|
|
328
|
-
restriction: string;
|
|
329
|
-
}
|
|
330
|
-
interface Platform {
|
|
331
|
-
relationship: 'allow' | 'deny';
|
|
332
|
-
platform: string;
|
|
333
|
-
}
|
|
2
|
+
import { ModuleOptions as ModuleOptions$1 } from '../dist/runtime/types.js';
|
|
334
3
|
|
|
335
4
|
interface ModuleOptions extends ModuleOptions$1 {
|
|
336
5
|
}
|
package/dist/module.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxtjs/sitemap",
|
|
3
3
|
"compatibility": {
|
|
4
|
-
"nuxt": "
|
|
4
|
+
"nuxt": ">=3.9.0",
|
|
5
5
|
"bridge": false
|
|
6
6
|
},
|
|
7
7
|
"configKey": "sitemap",
|
|
8
|
-
"version": "5.1
|
|
8
|
+
"version": "5.2.1",
|
|
9
|
+
"builder": {
|
|
10
|
+
"@nuxt/module-builder": "0.8.0",
|
|
11
|
+
"unbuild": "2.0.0"
|
|
12
|
+
}
|
|
9
13
|
}
|
package/dist/module.mjs
CHANGED
|
@@ -1,76 +1,18 @@
|
|
|
1
1
|
import { useNuxt, loadNuxtModuleInstance, createResolver, addTemplate, extendPages, defineNuxtModule, useLogger, hasNuxtModule, getNuxtModuleVersion, hasNuxtModuleCompatibility, addServerImports, addServerPlugin, addServerHandler, findPath, addPrerenderRoutes } from '@nuxt/kit';
|
|
2
|
-
import {
|
|
2
|
+
import { parseURL, withBase, joinURL, withoutLeadingSlash } from 'ufo';
|
|
3
3
|
import { assertSiteConfig, installNuxtSiteConfig } from 'nuxt-site-config-kit';
|
|
4
|
-
import {
|
|
4
|
+
import { defu } from 'defu';
|
|
5
5
|
import { readPackageJSON } from 'pkg-types';
|
|
6
6
|
import { statSync, existsSync } from 'node:fs';
|
|
7
7
|
import { extname, relative, dirname } from 'pathe';
|
|
8
|
-
import {
|
|
8
|
+
import { createPathFilter, splitForLocales, mergeOnKey } from '../dist/runtime/utils-pure.js';
|
|
9
9
|
import { provider, env } from 'std-env';
|
|
10
10
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
11
11
|
import { join } from 'node:path';
|
|
12
12
|
import chalk from 'chalk';
|
|
13
13
|
import { build } from 'nitropack';
|
|
14
14
|
import { withSiteUrl } from 'nuxt-site-config-kit/urls';
|
|
15
|
-
import '
|
|
16
|
-
|
|
17
|
-
const merger = createDefu((obj, key, value) => {
|
|
18
|
-
if (Array.isArray(obj[key]) && Array.isArray(value))
|
|
19
|
-
obj[key] = Array.from(/* @__PURE__ */ new Set([...obj[key], ...value]));
|
|
20
|
-
return obj[key];
|
|
21
|
-
});
|
|
22
|
-
function mergeOnKey(arr, key) {
|
|
23
|
-
const res = {};
|
|
24
|
-
arr.forEach((item) => {
|
|
25
|
-
const k = item[key];
|
|
26
|
-
res[k] = merger(item, res[k] || {});
|
|
27
|
-
});
|
|
28
|
-
return Object.values(res);
|
|
29
|
-
}
|
|
30
|
-
function splitForLocales(path, locales) {
|
|
31
|
-
const prefix = withLeadingSlash(path).split("/")[1];
|
|
32
|
-
if (locales.includes(prefix))
|
|
33
|
-
return [prefix, path.replace(`/${prefix}`, "")];
|
|
34
|
-
return [null, path];
|
|
35
|
-
}
|
|
36
|
-
function createPathFilter(options = {}) {
|
|
37
|
-
const urlFilter = createFilter(options);
|
|
38
|
-
return (loc) => {
|
|
39
|
-
let path = loc;
|
|
40
|
-
try {
|
|
41
|
-
path = parseURL(loc).pathname;
|
|
42
|
-
} catch {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
return urlFilter(path);
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
function createFilter(options = {}) {
|
|
49
|
-
const include = options.include || [];
|
|
50
|
-
const exclude = options.exclude || [];
|
|
51
|
-
if (include.length === 0 && exclude.length === 0)
|
|
52
|
-
return () => true;
|
|
53
|
-
return function(path) {
|
|
54
|
-
for (const v of [{ rules: exclude, result: false }, { rules: include, result: true }]) {
|
|
55
|
-
const regexRules = v.rules.filter((r) => r instanceof RegExp);
|
|
56
|
-
if (regexRules.some((r) => r.test(path)))
|
|
57
|
-
return v.result;
|
|
58
|
-
const stringRules = v.rules.filter((r) => typeof r === "string");
|
|
59
|
-
if (stringRules.length > 0) {
|
|
60
|
-
const routes = {};
|
|
61
|
-
for (const r of stringRules) {
|
|
62
|
-
if (r === path)
|
|
63
|
-
return v.result;
|
|
64
|
-
routes[r] = true;
|
|
65
|
-
}
|
|
66
|
-
const routeRulesMatcher = toRouteMatcher(createRouter({ routes, strictTrailingSlash: false }));
|
|
67
|
-
if (routeRulesMatcher.matchAll(path).length > 0)
|
|
68
|
-
return Boolean(v.result);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return include.length === 0;
|
|
72
|
-
};
|
|
73
|
-
}
|
|
15
|
+
import { normaliseDate } from '../dist/runtime/nitro/sitemap/urlset/normalise.js';
|
|
74
16
|
|
|
75
17
|
async function resolveUrls(urls) {
|
|
76
18
|
if (typeof urls === "function")
|
|
@@ -287,7 +229,7 @@ function extractSitemapMetaFromHtml(html, options) {
|
|
|
287
229
|
const mainRegex = /<main[^>]*>([\s\S]*?)<\/main>/;
|
|
288
230
|
const mainMatch = mainRegex.exec(html);
|
|
289
231
|
if (mainMatch?.[1] && mainMatch[1].includes("<img")) {
|
|
290
|
-
const imgRegex = /<img
|
|
232
|
+
const imgRegex = /<img\s+src=["']((?!data:|blob:|file:)[^"']+?)["'][^>]*>/gi;
|
|
291
233
|
let match;
|
|
292
234
|
while ((match = imgRegex.exec(mainMatch[1])) !== null) {
|
|
293
235
|
if (match.index === imgRegex.lastIndex)
|
|
@@ -457,38 +399,6 @@ function setupDevToolsUI(options, resolve, nuxt = useNuxt()) {
|
|
|
457
399
|
});
|
|
458
400
|
}
|
|
459
401
|
|
|
460
|
-
const IS_VALID_W3C_DATE = [
|
|
461
|
-
/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,
|
|
462
|
-
/^\d{4}-[01]\d-[0-3]\d$/,
|
|
463
|
-
/^\d{4}-[01]\d$/,
|
|
464
|
-
/^\d{4}$/
|
|
465
|
-
];
|
|
466
|
-
function isValidW3CDate(d) {
|
|
467
|
-
return IS_VALID_W3C_DATE.some((r) => r.test(d));
|
|
468
|
-
}
|
|
469
|
-
function normaliseDate(d) {
|
|
470
|
-
if (typeof d === "string") {
|
|
471
|
-
if (d.includes("T")) {
|
|
472
|
-
const t = d.split("T")[1];
|
|
473
|
-
if (!t.includes("+") && !t.includes("-") && !t.includes("Z")) {
|
|
474
|
-
d += "Z";
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
if (!isValidW3CDate(d))
|
|
478
|
-
return false;
|
|
479
|
-
d = new Date(d);
|
|
480
|
-
d.setMilliseconds(0);
|
|
481
|
-
if (Number.isNaN(d.getTime()))
|
|
482
|
-
return false;
|
|
483
|
-
}
|
|
484
|
-
const z = (n) => `0${n}`.slice(-2);
|
|
485
|
-
const date = `${d.getUTCFullYear()}-${z(d.getUTCMonth() + 1)}-${z(d.getUTCDate())}`;
|
|
486
|
-
if (d.getUTCHours() > 0 || d.getUTCMinutes() > 0 || d.getUTCSeconds() > 0) {
|
|
487
|
-
return `${date}T${z(d.getUTCHours())}:${z(d.getUTCMinutes())}:${z(d.getUTCSeconds())}Z`;
|
|
488
|
-
}
|
|
489
|
-
return date;
|
|
490
|
-
}
|
|
491
|
-
|
|
492
402
|
function splitPathForI18nLocales(path, autoI18n) {
|
|
493
403
|
const locales = autoI18n.strategy === "prefix_except_default" ? autoI18n.locales.filter((l) => l.code !== autoI18n.defaultLocale) : autoI18n.locales;
|
|
494
404
|
if (typeof path !== "string" || path.startsWith("/_"))
|
|
@@ -538,7 +448,7 @@ const module = defineNuxtModule({
|
|
|
538
448
|
meta: {
|
|
539
449
|
name: "@nuxtjs/sitemap",
|
|
540
450
|
compatibility: {
|
|
541
|
-
nuxt: "
|
|
451
|
+
nuxt: ">=3.9.0",
|
|
542
452
|
bridge: false
|
|
543
453
|
},
|
|
544
454
|
configKey: "sitemap"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { SitemapUrlInput } from '../../types';
|
|
1
|
+
import type { SitemapUrlInput } from '../../types.js';
|
|
2
2
|
export declare function asSitemapUrl(url: SitemapUrlInput | Record<string, any>): SitemapUrlInput;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type EventHandlerRequest, type EventHandlerResponse, defineEventHandler } from 'h3';
|
|
2
|
-
import type { SitemapUrlInput } from '../../types';
|
|
2
|
+
import type { SitemapUrlInput } from '../../types.js';
|
|
3
3
|
export declare const defineSitemapEventHandler: typeof defineEventHandler<EventHandlerRequest, EventHandlerResponse<SitemapUrlInput[]>>;
|
package/dist/runtime/nitro/middleware/{[sitemap]-sitemap.xml.mjs → [sitemap]-sitemap.xml.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createError, defineEventHandler } from "h3";
|
|
2
2
|
import { parseURL } from "ufo";
|
|
3
|
-
import { useSimpleSitemapRuntimeConfig } from "../utils.
|
|
4
|
-
import { createSitemap } from "../sitemap/nitro.
|
|
3
|
+
import { useSimpleSitemapRuntimeConfig } from "../utils.js";
|
|
4
|
+
import { createSitemap } from "../sitemap/nitro.js";
|
|
5
5
|
export default defineEventHandler(async (e) => {
|
|
6
6
|
const path = parseURL(e.path).pathname;
|
|
7
7
|
if (!path.endsWith("-sitemap.xml"))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defu } from "defu";
|
|
2
|
-
import { useSimpleSitemapRuntimeConfig } from "../utils.
|
|
2
|
+
import { useSimpleSitemapRuntimeConfig } from "../utils.js";
|
|
3
3
|
import { defineNitroPlugin } from "#imports";
|
|
4
4
|
export default defineNitroPlugin((nitroApp) => {
|
|
5
5
|
const { discoverImages, isNuxtContentDocumentDriven } = useSimpleSitemapRuntimeConfig();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { withLeadingSlash } from "ufo";
|
|
2
|
-
import { useSimpleSitemapRuntimeConfig } from "../utils.
|
|
2
|
+
import { useSimpleSitemapRuntimeConfig } from "../utils.js";
|
|
3
3
|
import { defineNitroPlugin } from "#imports";
|
|
4
4
|
export default defineNitroPlugin((nitroApp) => {
|
|
5
5
|
const { sitemaps } = useSimpleSitemapRuntimeConfig();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { SitemapDefinition } from '../../../types';
|
|
1
|
+
import type { SitemapDefinition } from '../../../types.js';
|
|
2
2
|
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<{
|
|
3
|
-
nitroOrigin:
|
|
3
|
+
nitroOrigin: string;
|
|
4
4
|
sitemaps: Record<string, SitemapDefinition>;
|
|
5
5
|
runtimeConfig: {
|
|
6
6
|
version: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineEventHandler } from "h3";
|
|
2
|
-
import { useSimpleSitemapRuntimeConfig } from "../../utils.
|
|
2
|
+
import { useSimpleSitemapRuntimeConfig } from "../../utils.js";
|
|
3
3
|
import {
|
|
4
4
|
childSitemapSources,
|
|
5
5
|
globalSitemapSources,
|
|
6
6
|
resolveSitemapSources
|
|
7
|
-
} from "../../sitemap/urlset/sources.
|
|
7
|
+
} from "../../sitemap/urlset/sources.js";
|
|
8
8
|
import { useNitroOrigin } from "#imports";
|
|
9
9
|
export default defineEventHandler(async (e) => {
|
|
10
10
|
const _runtimeConfig = useSimpleSitemapRuntimeConfig();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineEventHandler, sendRedirect } from "h3";
|
|
2
2
|
import { withBase } from "ufo";
|
|
3
|
-
import { useSimpleSitemapRuntimeConfig } from "../utils.
|
|
4
|
-
import { createSitemap } from "../sitemap/nitro.
|
|
3
|
+
import { useSimpleSitemapRuntimeConfig } from "../utils.js";
|
|
4
|
+
import { createSitemap } from "../sitemap/nitro.js";
|
|
5
5
|
import { useRuntimeConfig } from "#imports";
|
|
6
6
|
export default defineEventHandler(async (e) => {
|
|
7
7
|
const runtimeConfig = useSimpleSitemapRuntimeConfig();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineEventHandler, getHeader, setHeader } from "h3";
|
|
2
2
|
import { getQuery, parseURL, withQuery } from "ufo";
|
|
3
|
-
import { useSimpleSitemapRuntimeConfig } from "../utils.
|
|
3
|
+
import { useSimpleSitemapRuntimeConfig } from "../utils.js";
|
|
4
4
|
import { createSitePathResolver, useSiteConfig } from "#imports";
|
|
5
5
|
export default defineEventHandler(async (e) => {
|
|
6
6
|
const fixPath = createSitePathResolver(e, { absolute: false, withBase: true });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineEventHandler, getQuery, setHeader } from "h3";
|
|
2
2
|
import { fixSlashes } from "site-config-stack/urls";
|
|
3
|
-
import { useSimpleSitemapRuntimeConfig } from "../utils.
|
|
4
|
-
import { buildSitemapIndex } from "../sitemap/builder/sitemap-index.
|
|
3
|
+
import { useSimpleSitemapRuntimeConfig } from "../utils.js";
|
|
4
|
+
import { buildSitemapIndex } from "../sitemap/builder/sitemap-index.js";
|
|
5
5
|
import { createSitePathResolver, useNitroApp, useSiteConfig } from "#imports";
|
|
6
6
|
export default defineEventHandler(async (e) => {
|
|
7
7
|
const canonicalQuery = getQuery(e).canonical;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ModuleRuntimeConfig, NitroUrlResolvers } from '../../../types';
|
|
1
|
+
import type { ModuleRuntimeConfig, NitroUrlResolvers } from '../../../types.js';
|
|
2
2
|
export declare function buildSitemapIndex(resolvers: NitroUrlResolvers, runtimeConfig: ModuleRuntimeConfig): Promise<string>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defu } from "defu";
|
|
2
2
|
import { appendHeader } from "h3";
|
|
3
|
-
import { normaliseDate, normaliseSitemapUrls } from "../urlset/normalise.
|
|
4
|
-
import { globalSitemapSources, resolveSitemapSources } from "../urlset/sources.
|
|
5
|
-
import { applyI18nEnhancements } from "../urlset/i18n.
|
|
6
|
-
import { filterSitemapUrls } from "../urlset/filter.
|
|
7
|
-
import { sortSitemapUrls } from "../urlset/sort.
|
|
8
|
-
import { escapeValueForXml, wrapSitemapXml } from "./xml.
|
|
3
|
+
import { normaliseDate, normaliseSitemapUrls } from "../urlset/normalise.js";
|
|
4
|
+
import { globalSitemapSources, resolveSitemapSources } from "../urlset/sources.js";
|
|
5
|
+
import { applyI18nEnhancements } from "../urlset/i18n.js";
|
|
6
|
+
import { filterSitemapUrls } from "../urlset/filter.js";
|
|
7
|
+
import { sortSitemapUrls } from "../urlset/sort.js";
|
|
8
|
+
import { escapeValueForXml, wrapSitemapXml } from "./xml.js";
|
|
9
9
|
import { useNitroApp } from "#imports";
|
|
10
10
|
export async function buildSitemapIndex(resolvers, runtimeConfig) {
|
|
11
11
|
const {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ModuleRuntimeConfig, NitroUrlResolvers, SitemapDefinition } from '../../../types';
|
|
1
|
+
import type { ModuleRuntimeConfig, NitroUrlResolvers, SitemapDefinition } from '../../../types.js';
|
|
2
2
|
export declare function buildSitemap(sitemap: SitemapDefinition, resolvers: NitroUrlResolvers, runtimeConfig: ModuleRuntimeConfig): Promise<string>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { defu } from "defu";
|
|
2
2
|
import { resolveSitePath } from "site-config-stack/urls";
|
|
3
3
|
import { parseURL, withHttps } from "ufo";
|
|
4
|
-
import { normaliseSitemapUrls } from "../urlset/normalise.
|
|
5
|
-
import { childSitemapSources, globalSitemapSources, resolveSitemapSources } from "../urlset/sources.
|
|
6
|
-
import { filterSitemapUrls } from "../urlset/filter.
|
|
7
|
-
import { applyI18nEnhancements, normaliseI18nSources } from "../urlset/i18n.
|
|
8
|
-
import { sortSitemapUrls } from "../urlset/sort.
|
|
9
|
-
import { splitForLocales } from "../../utils.
|
|
10
|
-
import { createNitroRouteRuleMatcher } from "../../kit.
|
|
11
|
-
import { handleEntry, wrapSitemapXml } from "./xml.
|
|
4
|
+
import { normaliseSitemapUrls } from "../urlset/normalise.js";
|
|
5
|
+
import { childSitemapSources, globalSitemapSources, resolveSitemapSources } from "../urlset/sources.js";
|
|
6
|
+
import { filterSitemapUrls } from "../urlset/filter.js";
|
|
7
|
+
import { applyI18nEnhancements, normaliseI18nSources } from "../urlset/i18n.js";
|
|
8
|
+
import { sortSitemapUrls } from "../urlset/sort.js";
|
|
9
|
+
import { splitForLocales } from "../../utils.js";
|
|
10
|
+
import { createNitroRouteRuleMatcher } from "../../kit.js";
|
|
11
|
+
import { handleEntry, wrapSitemapXml } from "./xml.js";
|
|
12
12
|
import { useNitroApp } from "#imports";
|
|
13
13
|
export async function buildSitemap(sitemap, resolvers, runtimeConfig) {
|
|
14
14
|
const {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ModuleRuntimeConfig, NitroUrlResolvers } from '../../../types';
|
|
1
|
+
import type { ModuleRuntimeConfig, NitroUrlResolvers } from '../../../types.js';
|
|
2
2
|
export declare function handleEntry(k: string, e: Record<string, any> | (string | Record<string, any>)[]): string | false;
|
|
3
3
|
export declare function wrapSitemapXml(input: string[], resolvers: NitroUrlResolvers, options: Pick<ModuleRuntimeConfig, 'version' | 'xsl' | 'credits'>): string;
|
|
4
4
|
export declare function escapeValueForXml(value: boolean | string | number): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type H3Event } from 'h3';
|
|
2
|
-
import type { ModuleRuntimeConfig, NitroUrlResolvers, SitemapDefinition } from '../../types';
|
|
2
|
+
import type { ModuleRuntimeConfig, NitroUrlResolvers, SitemapDefinition } from '../../types.js';
|
|
3
3
|
export declare function useNitroUrlResolvers(e: H3Event): NitroUrlResolvers;
|
|
4
4
|
export declare function createSitemap(e: H3Event, definition: SitemapDefinition, runtimeConfig: ModuleRuntimeConfig): Promise<string>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getQuery, setHeader } from "h3";
|
|
2
2
|
import { fixSlashes } from "site-config-stack/urls";
|
|
3
|
-
import { buildSitemap } from "./builder/sitemap.
|
|
4
|
-
import { buildSitemapIndex } from "./builder/sitemap-index.
|
|
3
|
+
import { buildSitemap } from "./builder/sitemap.js";
|
|
4
|
+
import { buildSitemapIndex } from "./builder/sitemap-index.js";
|
|
5
5
|
import { createSitePathResolver, useNitroApp, useSiteConfig } from "#imports";
|
|
6
6
|
export function useNitroUrlResolvers(e) {
|
|
7
7
|
const canonicalQuery = getQuery(e).canonical;
|