@docusaurus/plugin-sitemap 3.4.0 → 3.5.0
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 +1 -1
- package/lib/createSitemapItem.js +1 -2
- package/lib/head.js +1 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/options.js +2 -2
- package/lib/xml.js +1 -2
- package/package.json +8 -8
- package/src/index.ts +2 -2
package/lib/createSitemap.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.default = createSitemap;
|
|
9
10
|
const utils_1 = require("@docusaurus/utils");
|
|
10
11
|
const xml_1 = require("./xml");
|
|
11
12
|
const createSitemapItem_1 = require("./createSitemapItem");
|
|
@@ -58,4 +59,3 @@ async function createSitemap(params) {
|
|
|
58
59
|
});
|
|
59
60
|
return xmlString;
|
|
60
61
|
}
|
|
61
|
-
exports.default = createSitemap;
|
package/lib/createSitemapItem.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.createSitemapItem =
|
|
9
|
+
exports.createSitemapItem = createSitemapItem;
|
|
10
10
|
const utils_common_1 = require("@docusaurus/utils-common");
|
|
11
11
|
const utils_1 = require("@docusaurus/utils");
|
|
12
12
|
async function getRouteLastUpdatedAt(route) {
|
|
@@ -49,4 +49,3 @@ async function createSitemapItem({ route, siteConfig, options, }) {
|
|
|
49
49
|
lastmod: await getRouteLastmod({ route, lastmod }),
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
exports.createSitemapItem = createSitemapItem;
|
package/lib/head.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.isNoIndexMetaRoute =
|
|
9
|
+
exports.isNoIndexMetaRoute = isNoIndexMetaRoute;
|
|
10
10
|
// Maybe we want to add a routeConfig.metadata.noIndex instead?
|
|
11
11
|
// But using Helmet is more reliable for third-party plugins...
|
|
12
12
|
function isNoIndexMetaRoute({ head, route, }) {
|
|
@@ -24,4 +24,3 @@ function isNoIndexMetaRoute({ head, route, }) {
|
|
|
24
24
|
const meta = head[route]?.meta.toComponent();
|
|
25
25
|
return (meta?.some((tag) => isNoIndexMetaTag({ name: tag.props.name, content: tag.props.content })) ?? false);
|
|
26
26
|
}
|
|
27
|
-
exports.isNoIndexMetaRoute = isNoIndexMetaRoute;
|
package/lib/index.d.ts
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { PluginOptions, Options } from './options';
|
|
8
8
|
import type { LoadContext, Plugin } from '@docusaurus/types';
|
|
9
|
-
export default function pluginSitemap(context: LoadContext, options: PluginOptions): Plugin<void
|
|
9
|
+
export default function pluginSitemap(context: LoadContext, options: PluginOptions): Plugin<void> | null;
|
|
10
10
|
export { validateOptions } from './options';
|
|
11
11
|
export type { PluginOptions, Options };
|
package/lib/index.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.validateOptions = void 0;
|
|
10
|
+
exports.default = pluginSitemap;
|
|
10
11
|
const tslib_1 = require("tslib");
|
|
11
12
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
12
13
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
@@ -16,7 +17,7 @@ const PluginName = 'docusaurus-plugin-sitemap';
|
|
|
16
17
|
function pluginSitemap(context, options) {
|
|
17
18
|
if (context.siteConfig.future.experimental_router === 'hash') {
|
|
18
19
|
logger_1.default.warn(`${PluginName} does not support the Hash Router and will be disabled.`);
|
|
19
|
-
return
|
|
20
|
+
return null;
|
|
20
21
|
}
|
|
21
22
|
return {
|
|
22
23
|
name: PluginName,
|
|
@@ -46,6 +47,5 @@ function pluginSitemap(context, options) {
|
|
|
46
47
|
},
|
|
47
48
|
};
|
|
48
49
|
}
|
|
49
|
-
exports.default = pluginSitemap;
|
|
50
50
|
var options_1 = require("./options");
|
|
51
51
|
Object.defineProperty(exports, "validateOptions", { enumerable: true, get: function () { return options_1.validateOptions; } });
|
package/lib/options.js
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.DEFAULT_OPTIONS = void 0;
|
|
10
|
+
exports.validateOptions = validateOptions;
|
|
10
11
|
const utils_validation_1 = require("@docusaurus/utils-validation");
|
|
11
12
|
const types_1 = require("./types");
|
|
12
13
|
exports.DEFAULT_OPTIONS = {
|
|
@@ -56,4 +57,3 @@ function validateOptions({ validate, options, }) {
|
|
|
56
57
|
const validatedOptions = validate(PluginOptionSchema, options);
|
|
57
58
|
return validatedOptions;
|
|
58
59
|
}
|
|
59
|
-
exports.validateOptions = validateOptions;
|
package/lib/xml.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.sitemapItemsToXmlString =
|
|
9
|
+
exports.sitemapItemsToXmlString = sitemapItemsToXmlString;
|
|
10
10
|
const sitemap_1 = require("sitemap");
|
|
11
11
|
async function sitemapItemsToXmlString(items, options) {
|
|
12
12
|
if (items.length === 0) {
|
|
@@ -27,4 +27,3 @@ async function sitemapItemsToXmlString(items, options) {
|
|
|
27
27
|
const buffer = await (0, sitemap_1.streamToPromise)(sitemapStream);
|
|
28
28
|
return buffer.toString();
|
|
29
29
|
}
|
|
30
|
-
exports.sitemapItemsToXmlString = sitemapItemsToXmlString;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-sitemap",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "Simple sitemap generation plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@docusaurus/core": "3.
|
|
22
|
-
"@docusaurus/logger": "3.
|
|
23
|
-
"@docusaurus/types": "3.
|
|
24
|
-
"@docusaurus/utils": "3.
|
|
25
|
-
"@docusaurus/utils-common": "3.
|
|
26
|
-
"@docusaurus/utils-validation": "3.
|
|
21
|
+
"@docusaurus/core": "3.5.0",
|
|
22
|
+
"@docusaurus/logger": "3.5.0",
|
|
23
|
+
"@docusaurus/types": "3.5.0",
|
|
24
|
+
"@docusaurus/utils": "3.5.0",
|
|
25
|
+
"@docusaurus/utils-common": "3.5.0",
|
|
26
|
+
"@docusaurus/utils-validation": "3.5.0",
|
|
27
27
|
"fs-extra": "^11.1.1",
|
|
28
28
|
"sitemap": "^7.1.1",
|
|
29
29
|
"tslib": "^2.6.0"
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"engines": {
|
|
39
39
|
"node": ">=18.0"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "cb5829f3c34b26d798b869e38ee25073488140bd"
|
|
42
42
|
}
|
package/src/index.ts
CHANGED
|
@@ -17,12 +17,12 @@ const PluginName = 'docusaurus-plugin-sitemap';
|
|
|
17
17
|
export default function pluginSitemap(
|
|
18
18
|
context: LoadContext,
|
|
19
19
|
options: PluginOptions,
|
|
20
|
-
): Plugin<void> {
|
|
20
|
+
): Plugin<void> | null {
|
|
21
21
|
if (context.siteConfig.future.experimental_router === 'hash') {
|
|
22
22
|
logger.warn(
|
|
23
23
|
`${PluginName} does not support the Hash Router and will be disabled.`,
|
|
24
24
|
);
|
|
25
|
-
return
|
|
25
|
+
return null;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
return {
|