@onruntime/next-sitemap 0.9.2 → 0.9.3
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/app/index.cjs +5 -2
- package/dist/app/index.js +5 -2
- package/dist/index.cjs +5 -2
- package/dist/index.js +5 -2
- package/dist/pages/index.cjs +5 -2
- package/dist/pages/index.js +5 -2
- package/package.json +1 -1
package/dist/app/index.cjs
CHANGED
|
@@ -268,6 +268,9 @@ function normalizePath(pathname) {
|
|
|
268
268
|
if (pathname === "/") return pathname;
|
|
269
269
|
return pathname.endsWith("/") ? pathname.slice(0, -1) : pathname;
|
|
270
270
|
}
|
|
271
|
+
function formatDateW3C(date) {
|
|
272
|
+
return date.toISOString().replace(/\.\d{3}Z$/, "+00:00");
|
|
273
|
+
}
|
|
271
274
|
function buildUrl(baseUrl, pathname, locale, defaultLocale) {
|
|
272
275
|
const normalizedPath = normalizePath(pathname);
|
|
273
276
|
const pathSuffix = pathname === "/" ? "" : normalizedPath;
|
|
@@ -288,7 +291,7 @@ function generateSitemapXml(entries, options) {
|
|
|
288
291
|
}
|
|
289
292
|
}
|
|
290
293
|
if (entry.lastModified) {
|
|
291
|
-
const date = entry.lastModified instanceof Date ? entry.lastModified
|
|
294
|
+
const date = entry.lastModified instanceof Date ? formatDateW3C(entry.lastModified) : entry.lastModified;
|
|
292
295
|
parts.push(` <lastmod>${date}</lastmod>`);
|
|
293
296
|
}
|
|
294
297
|
if (entry.changeFrequency) {
|
|
@@ -309,7 +312,7 @@ ${urlEntries}
|
|
|
309
312
|
}
|
|
310
313
|
function generateSitemapIndexXml(baseUrl, sitemapCount, options) {
|
|
311
314
|
const { sitemapPattern = "/sitemap-{id}.xml", additionalSitemaps = [], poweredBy = true } = options || {};
|
|
312
|
-
const now = (/* @__PURE__ */ new Date())
|
|
315
|
+
const now = formatDateW3C(/* @__PURE__ */ new Date());
|
|
313
316
|
const paginatedEntries = Array.from({ length: sitemapCount }, (_, i) => {
|
|
314
317
|
const loc = `${baseUrl}${sitemapPattern.replace("{id}", String(i))}`;
|
|
315
318
|
return ` <sitemap>
|
package/dist/app/index.js
CHANGED
|
@@ -245,6 +245,9 @@ function normalizePath(pathname) {
|
|
|
245
245
|
if (pathname === "/") return pathname;
|
|
246
246
|
return pathname.endsWith("/") ? pathname.slice(0, -1) : pathname;
|
|
247
247
|
}
|
|
248
|
+
function formatDateW3C(date) {
|
|
249
|
+
return date.toISOString().replace(/\.\d{3}Z$/, "+00:00");
|
|
250
|
+
}
|
|
248
251
|
function buildUrl(baseUrl, pathname, locale, defaultLocale) {
|
|
249
252
|
const normalizedPath = normalizePath(pathname);
|
|
250
253
|
const pathSuffix = pathname === "/" ? "" : normalizedPath;
|
|
@@ -265,7 +268,7 @@ function generateSitemapXml(entries, options) {
|
|
|
265
268
|
}
|
|
266
269
|
}
|
|
267
270
|
if (entry.lastModified) {
|
|
268
|
-
const date = entry.lastModified instanceof Date ? entry.lastModified
|
|
271
|
+
const date = entry.lastModified instanceof Date ? formatDateW3C(entry.lastModified) : entry.lastModified;
|
|
269
272
|
parts.push(` <lastmod>${date}</lastmod>`);
|
|
270
273
|
}
|
|
271
274
|
if (entry.changeFrequency) {
|
|
@@ -286,7 +289,7 @@ ${urlEntries}
|
|
|
286
289
|
}
|
|
287
290
|
function generateSitemapIndexXml(baseUrl, sitemapCount, options) {
|
|
288
291
|
const { sitemapPattern = "/sitemap-{id}.xml", additionalSitemaps = [], poweredBy = true } = options || {};
|
|
289
|
-
const now = (/* @__PURE__ */ new Date())
|
|
292
|
+
const now = formatDateW3C(/* @__PURE__ */ new Date());
|
|
290
293
|
const paginatedEntries = Array.from({ length: sitemapCount }, (_, i) => {
|
|
291
294
|
const loc = `${baseUrl}${sitemapPattern.replace("{id}", String(i))}`;
|
|
292
295
|
return ` <sitemap>
|
package/dist/index.cjs
CHANGED
|
@@ -268,6 +268,9 @@ function normalizePath(pathname) {
|
|
|
268
268
|
if (pathname === "/") return pathname;
|
|
269
269
|
return pathname.endsWith("/") ? pathname.slice(0, -1) : pathname;
|
|
270
270
|
}
|
|
271
|
+
function formatDateW3C(date) {
|
|
272
|
+
return date.toISOString().replace(/\.\d{3}Z$/, "+00:00");
|
|
273
|
+
}
|
|
271
274
|
function buildUrl(baseUrl, pathname, locale, defaultLocale) {
|
|
272
275
|
const normalizedPath = normalizePath(pathname);
|
|
273
276
|
const pathSuffix = pathname === "/" ? "" : normalizedPath;
|
|
@@ -288,7 +291,7 @@ function generateSitemapXml(entries, options) {
|
|
|
288
291
|
}
|
|
289
292
|
}
|
|
290
293
|
if (entry.lastModified) {
|
|
291
|
-
const date = entry.lastModified instanceof Date ? entry.lastModified
|
|
294
|
+
const date = entry.lastModified instanceof Date ? formatDateW3C(entry.lastModified) : entry.lastModified;
|
|
292
295
|
parts.push(` <lastmod>${date}</lastmod>`);
|
|
293
296
|
}
|
|
294
297
|
if (entry.changeFrequency) {
|
|
@@ -309,7 +312,7 @@ ${urlEntries}
|
|
|
309
312
|
}
|
|
310
313
|
function generateSitemapIndexXml(baseUrl, sitemapCount, options) {
|
|
311
314
|
const { sitemapPattern = "/sitemap-{id}.xml", additionalSitemaps = [], poweredBy = true } = options || {};
|
|
312
|
-
const now = (/* @__PURE__ */ new Date())
|
|
315
|
+
const now = formatDateW3C(/* @__PURE__ */ new Date());
|
|
313
316
|
const paginatedEntries = Array.from({ length: sitemapCount }, (_, i) => {
|
|
314
317
|
const loc = `${baseUrl}${sitemapPattern.replace("{id}", String(i))}`;
|
|
315
318
|
return ` <sitemap>
|
package/dist/index.js
CHANGED
|
@@ -245,6 +245,9 @@ function normalizePath(pathname) {
|
|
|
245
245
|
if (pathname === "/") return pathname;
|
|
246
246
|
return pathname.endsWith("/") ? pathname.slice(0, -1) : pathname;
|
|
247
247
|
}
|
|
248
|
+
function formatDateW3C(date) {
|
|
249
|
+
return date.toISOString().replace(/\.\d{3}Z$/, "+00:00");
|
|
250
|
+
}
|
|
248
251
|
function buildUrl(baseUrl, pathname, locale, defaultLocale) {
|
|
249
252
|
const normalizedPath = normalizePath(pathname);
|
|
250
253
|
const pathSuffix = pathname === "/" ? "" : normalizedPath;
|
|
@@ -265,7 +268,7 @@ function generateSitemapXml(entries, options) {
|
|
|
265
268
|
}
|
|
266
269
|
}
|
|
267
270
|
if (entry.lastModified) {
|
|
268
|
-
const date = entry.lastModified instanceof Date ? entry.lastModified
|
|
271
|
+
const date = entry.lastModified instanceof Date ? formatDateW3C(entry.lastModified) : entry.lastModified;
|
|
269
272
|
parts.push(` <lastmod>${date}</lastmod>`);
|
|
270
273
|
}
|
|
271
274
|
if (entry.changeFrequency) {
|
|
@@ -286,7 +289,7 @@ ${urlEntries}
|
|
|
286
289
|
}
|
|
287
290
|
function generateSitemapIndexXml(baseUrl, sitemapCount, options) {
|
|
288
291
|
const { sitemapPattern = "/sitemap-{id}.xml", additionalSitemaps = [], poweredBy = true } = options || {};
|
|
289
|
-
const now = (/* @__PURE__ */ new Date())
|
|
292
|
+
const now = formatDateW3C(/* @__PURE__ */ new Date());
|
|
290
293
|
const paginatedEntries = Array.from({ length: sitemapCount }, (_, i) => {
|
|
291
294
|
const loc = `${baseUrl}${sitemapPattern.replace("{id}", String(i))}`;
|
|
292
295
|
return ` <sitemap>
|
package/dist/pages/index.cjs
CHANGED
|
@@ -268,6 +268,9 @@ function normalizePath(pathname) {
|
|
|
268
268
|
if (pathname === "/") return pathname;
|
|
269
269
|
return pathname.endsWith("/") ? pathname.slice(0, -1) : pathname;
|
|
270
270
|
}
|
|
271
|
+
function formatDateW3C(date) {
|
|
272
|
+
return date.toISOString().replace(/\.\d{3}Z$/, "+00:00");
|
|
273
|
+
}
|
|
271
274
|
function buildUrl(baseUrl, pathname, locale, defaultLocale) {
|
|
272
275
|
const normalizedPath = normalizePath(pathname);
|
|
273
276
|
const pathSuffix = pathname === "/" ? "" : normalizedPath;
|
|
@@ -288,7 +291,7 @@ function generateSitemapXml(entries, options) {
|
|
|
288
291
|
}
|
|
289
292
|
}
|
|
290
293
|
if (entry.lastModified) {
|
|
291
|
-
const date = entry.lastModified instanceof Date ? entry.lastModified
|
|
294
|
+
const date = entry.lastModified instanceof Date ? formatDateW3C(entry.lastModified) : entry.lastModified;
|
|
292
295
|
parts.push(` <lastmod>${date}</lastmod>`);
|
|
293
296
|
}
|
|
294
297
|
if (entry.changeFrequency) {
|
|
@@ -309,7 +312,7 @@ ${urlEntries}
|
|
|
309
312
|
}
|
|
310
313
|
function generateSitemapIndexXml(baseUrl, sitemapCount, options) {
|
|
311
314
|
const { sitemapPattern = "/sitemap-{id}.xml", additionalSitemaps = [], poweredBy = true } = options || {};
|
|
312
|
-
const now = (/* @__PURE__ */ new Date())
|
|
315
|
+
const now = formatDateW3C(/* @__PURE__ */ new Date());
|
|
313
316
|
const paginatedEntries = Array.from({ length: sitemapCount }, (_, i) => {
|
|
314
317
|
const loc = `${baseUrl}${sitemapPattern.replace("{id}", String(i))}`;
|
|
315
318
|
return ` <sitemap>
|
package/dist/pages/index.js
CHANGED
|
@@ -245,6 +245,9 @@ function normalizePath(pathname) {
|
|
|
245
245
|
if (pathname === "/") return pathname;
|
|
246
246
|
return pathname.endsWith("/") ? pathname.slice(0, -1) : pathname;
|
|
247
247
|
}
|
|
248
|
+
function formatDateW3C(date) {
|
|
249
|
+
return date.toISOString().replace(/\.\d{3}Z$/, "+00:00");
|
|
250
|
+
}
|
|
248
251
|
function buildUrl(baseUrl, pathname, locale, defaultLocale) {
|
|
249
252
|
const normalizedPath = normalizePath(pathname);
|
|
250
253
|
const pathSuffix = pathname === "/" ? "" : normalizedPath;
|
|
@@ -265,7 +268,7 @@ function generateSitemapXml(entries, options) {
|
|
|
265
268
|
}
|
|
266
269
|
}
|
|
267
270
|
if (entry.lastModified) {
|
|
268
|
-
const date = entry.lastModified instanceof Date ? entry.lastModified
|
|
271
|
+
const date = entry.lastModified instanceof Date ? formatDateW3C(entry.lastModified) : entry.lastModified;
|
|
269
272
|
parts.push(` <lastmod>${date}</lastmod>`);
|
|
270
273
|
}
|
|
271
274
|
if (entry.changeFrequency) {
|
|
@@ -286,7 +289,7 @@ ${urlEntries}
|
|
|
286
289
|
}
|
|
287
290
|
function generateSitemapIndexXml(baseUrl, sitemapCount, options) {
|
|
288
291
|
const { sitemapPattern = "/sitemap-{id}.xml", additionalSitemaps = [], poweredBy = true } = options || {};
|
|
289
|
-
const now = (/* @__PURE__ */ new Date())
|
|
292
|
+
const now = formatDateW3C(/* @__PURE__ */ new Date());
|
|
290
293
|
const paginatedEntries = Array.from({ length: sitemapCount }, (_, i) => {
|
|
291
294
|
const loc = `${baseUrl}${sitemapPattern.replace("{id}", String(i))}`;
|
|
292
295
|
return ` <sitemap>
|
package/package.json
CHANGED