@docusaurus/plugin-sitemap 4.0.0-canary-6879 → 4.0.0-canary-6881
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/lib/xml.js +5 -6
- package/package.json +10 -10
- package/src/xml.ts +5 -6
package/lib/xml.js
CHANGED
|
@@ -10,14 +10,13 @@ exports.sitemapItemsToXmlString = sitemapItemsToXmlString;
|
|
|
10
10
|
const sitemap_1 = require("sitemap");
|
|
11
11
|
async function sitemapItemsToXmlString(items, options) {
|
|
12
12
|
if (items.length === 0) {
|
|
13
|
-
//
|
|
14
|
-
// and the code below would never resolve, so it's better to fail fast
|
|
13
|
+
// Fail fast with a clearer error than the lib's EmptySitemap error
|
|
15
14
|
throw new Error("Can't generate a sitemap with no items");
|
|
16
15
|
}
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
16
|
+
// We could generate the XML ourselves, but we keep using the lib on purpose
|
|
17
|
+
// Users can return undocumented fields from createSitemapItems()
|
|
18
|
+
// (links, img, video, news...) that the lib serializes
|
|
19
|
+
// See https://github.com/ekalinin/sitemap.js
|
|
21
20
|
const sitemapStream = new sitemap_1.SitemapStream({
|
|
22
21
|
// WTF is this lib reformatting the string YYYY-MM-DD to datetime...
|
|
23
22
|
lastmodDateOnly: options?.lastmod === 'date',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-sitemap",
|
|
3
|
-
"version": "4.0.0-canary-
|
|
3
|
+
"version": "4.0.0-canary-6881",
|
|
4
4
|
"description": "Simple sitemap generation plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@docusaurus/core": "4.0.0-canary-
|
|
22
|
-
"@docusaurus/glob": "4.0.0-canary-
|
|
23
|
-
"@docusaurus/logger": "4.0.0-canary-
|
|
24
|
-
"@docusaurus/types": "4.0.0-canary-
|
|
25
|
-
"@docusaurus/utils": "4.0.0-canary-
|
|
26
|
-
"@docusaurus/utils-common": "4.0.0-canary-
|
|
27
|
-
"@docusaurus/utils-validation": "4.0.0-canary-
|
|
21
|
+
"@docusaurus/core": "4.0.0-canary-6881",
|
|
22
|
+
"@docusaurus/glob": "4.0.0-canary-6881",
|
|
23
|
+
"@docusaurus/logger": "4.0.0-canary-6881",
|
|
24
|
+
"@docusaurus/types": "4.0.0-canary-6881",
|
|
25
|
+
"@docusaurus/utils": "4.0.0-canary-6881",
|
|
26
|
+
"@docusaurus/utils-common": "4.0.0-canary-6881",
|
|
27
|
+
"@docusaurus/utils-validation": "4.0.0-canary-6881",
|
|
28
28
|
"fs-extra": "^11.4.0",
|
|
29
|
-
"sitemap": "^
|
|
29
|
+
"sitemap": "^9.0.1",
|
|
30
30
|
"tslib": "^2.8.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"engines": {
|
|
40
40
|
"node": ">=24.21"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "e430343b0caccec7c7db3553dca51f181d3d9c3b"
|
|
43
43
|
}
|
package/src/xml.ts
CHANGED
|
@@ -13,15 +13,14 @@ export async function sitemapItemsToXmlString(
|
|
|
13
13
|
options: {lastmod: LastModOption | null},
|
|
14
14
|
): Promise<string> {
|
|
15
15
|
if (items.length === 0) {
|
|
16
|
-
//
|
|
17
|
-
// and the code below would never resolve, so it's better to fail fast
|
|
16
|
+
// Fail fast with a clearer error than the lib's EmptySitemap error
|
|
18
17
|
throw new Error("Can't generate a sitemap with no items");
|
|
19
18
|
}
|
|
20
19
|
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
20
|
+
// We could generate the XML ourselves, but we keep using the lib on purpose
|
|
21
|
+
// Users can return undocumented fields from createSitemapItems()
|
|
22
|
+
// (links, img, video, news...) that the lib serializes
|
|
23
|
+
// See https://github.com/ekalinin/sitemap.js
|
|
25
24
|
const sitemapStream = new SitemapStream({
|
|
26
25
|
// WTF is this lib reformatting the string YYYY-MM-DD to datetime...
|
|
27
26
|
lastmodDateOnly: options?.lastmod === 'date',
|