@docusaurus/plugin-sitemap 4.0.0-canary-7110 → 4.0.0-canary-7130
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/createSitemap.js +0 -3
- package/lib/xml.js +0 -4
- package/package.json +10 -10
- package/src/createSitemap.ts +0 -3
- package/src/xml.ts +0 -5
package/lib/createSitemap.js
CHANGED
|
@@ -29,9 +29,6 @@ function getSitemapRoutes({ routes, routesBuildMetadata, options, }) {
|
|
|
29
29
|
function createDefaultCreateSitemapItems(internalParams) {
|
|
30
30
|
return async (params) => {
|
|
31
31
|
const sitemapRoutes = getSitemapRoutes({ ...params, ...internalParams });
|
|
32
|
-
if (sitemapRoutes.length === 0) {
|
|
33
|
-
return [];
|
|
34
|
-
}
|
|
35
32
|
return Promise.all(sitemapRoutes.map((route) => (0, createSitemapItem_1.createSitemapItem)({
|
|
36
33
|
route,
|
|
37
34
|
siteConfig: params.siteConfig,
|
package/lib/xml.js
CHANGED
|
@@ -9,10 +9,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.sitemapItemsToXmlString = sitemapItemsToXmlString;
|
|
10
10
|
const sitemap_1 = require("sitemap");
|
|
11
11
|
async function sitemapItemsToXmlString(items, options) {
|
|
12
|
-
if (items.length === 0) {
|
|
13
|
-
// Fail fast with a clearer error than the lib's EmptySitemap error
|
|
14
|
-
throw new Error("Can't generate a sitemap with no items");
|
|
15
|
-
}
|
|
16
12
|
// We could generate the XML ourselves, but we keep using the lib on purpose
|
|
17
13
|
// Users can return undocumented fields from createSitemapItems()
|
|
18
14
|
// (links, img, video, news...) that the lib serializes
|
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-7130",
|
|
4
4
|
"description": "Simple sitemap generation plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
},
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@docusaurus/core": "4.0.0-canary-
|
|
18
|
-
"@docusaurus/fs": "4.0.0-canary-
|
|
19
|
-
"@docusaurus/glob": "4.0.0-canary-
|
|
20
|
-
"@docusaurus/logger": "4.0.0-canary-
|
|
21
|
-
"@docusaurus/types": "4.0.0-canary-
|
|
22
|
-
"@docusaurus/utils": "4.0.0-canary-
|
|
23
|
-
"@docusaurus/utils-common": "4.0.0-canary-
|
|
24
|
-
"@docusaurus/utils-validation": "4.0.0-canary-
|
|
17
|
+
"@docusaurus/core": "4.0.0-canary-7130",
|
|
18
|
+
"@docusaurus/fs": "4.0.0-canary-7130",
|
|
19
|
+
"@docusaurus/glob": "4.0.0-canary-7130",
|
|
20
|
+
"@docusaurus/logger": "4.0.0-canary-7130",
|
|
21
|
+
"@docusaurus/types": "4.0.0-canary-7130",
|
|
22
|
+
"@docusaurus/utils": "4.0.0-canary-7130",
|
|
23
|
+
"@docusaurus/utils-common": "4.0.0-canary-7130",
|
|
24
|
+
"@docusaurus/utils-validation": "4.0.0-canary-7130",
|
|
25
25
|
"lodash": "^4.18.1",
|
|
26
|
-
"sitemap": "^
|
|
26
|
+
"sitemap": "^10.0.0",
|
|
27
27
|
"tslib": "^2.8.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
package/src/createSitemap.ts
CHANGED
|
@@ -43,9 +43,6 @@ function createDefaultCreateSitemapItems(
|
|
|
43
43
|
): CreateSitemapItemsFn {
|
|
44
44
|
return async (params) => {
|
|
45
45
|
const sitemapRoutes = getSitemapRoutes({...params, ...internalParams});
|
|
46
|
-
if (sitemapRoutes.length === 0) {
|
|
47
|
-
return [];
|
|
48
|
-
}
|
|
49
46
|
return Promise.all(
|
|
50
47
|
sitemapRoutes.map((route) =>
|
|
51
48
|
createSitemapItem({
|
package/src/xml.ts
CHANGED
|
@@ -12,11 +12,6 @@ export async function sitemapItemsToXmlString(
|
|
|
12
12
|
items: SitemapItem[],
|
|
13
13
|
options: {lastmod: LastModOption | null},
|
|
14
14
|
): Promise<string> {
|
|
15
|
-
if (items.length === 0) {
|
|
16
|
-
// Fail fast with a clearer error than the lib's EmptySitemap error
|
|
17
|
-
throw new Error("Can't generate a sitemap with no items");
|
|
18
|
-
}
|
|
19
|
-
|
|
20
15
|
// We could generate the XML ourselves, but we keep using the lib on purpose
|
|
21
16
|
// Users can return undocumented fields from createSitemapItems()
|
|
22
17
|
// (links, img, video, news...) that the lib serializes
|