@docusaurus/plugin-sitemap 0.0.0-5066 → 0.0.0-5069
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/index.js +1 -1
- package/lib/options.d.ts +5 -0
- package/lib/options.js +2 -0
- package/package.json +8 -8
- package/src/index.ts +1 -1
- package/src/options.ts +7 -0
package/lib/index.js
CHANGED
|
@@ -22,7 +22,7 @@ function pluginSitemap(context, options) {
|
|
|
22
22
|
// Generate sitemap.
|
|
23
23
|
const generatedSitemap = await (0, createSitemap_1.default)(siteConfig, routesPaths, head, options);
|
|
24
24
|
// Write sitemap file.
|
|
25
|
-
const sitemapPath = path_1.default.join(outDir,
|
|
25
|
+
const sitemapPath = path_1.default.join(outDir, options.filename);
|
|
26
26
|
try {
|
|
27
27
|
await fs_extra_1.default.outputFile(sitemapPath, generatedSitemap);
|
|
28
28
|
}
|
package/lib/options.d.ts
CHANGED
|
@@ -16,6 +16,11 @@ export declare type PluginOptions = {
|
|
|
16
16
|
* sitemap. Note that you may need to include the base URL in here.
|
|
17
17
|
*/
|
|
18
18
|
ignorePatterns: string[];
|
|
19
|
+
/**
|
|
20
|
+
* The path to the created sitemap file, relative to the output directory.
|
|
21
|
+
* Useful if you have two plugin instances outputting two files.
|
|
22
|
+
*/
|
|
23
|
+
filename: string;
|
|
19
24
|
};
|
|
20
25
|
export declare type Options = Partial<PluginOptions>;
|
|
21
26
|
export declare const DEFAULT_OPTIONS: PluginOptions;
|
package/lib/options.js
CHANGED
|
@@ -13,6 +13,7 @@ exports.DEFAULT_OPTIONS = {
|
|
|
13
13
|
changefreq: sitemap_1.EnumChangefreq.WEEKLY,
|
|
14
14
|
priority: 0.5,
|
|
15
15
|
ignorePatterns: [],
|
|
16
|
+
filename: 'sitemap.xml',
|
|
16
17
|
};
|
|
17
18
|
const PluginOptionSchema = utils_validation_1.Joi.object({
|
|
18
19
|
// @ts-expect-error: forbidden
|
|
@@ -29,6 +30,7 @@ const PluginOptionSchema = utils_validation_1.Joi.object({
|
|
|
29
30
|
trailingSlash: utils_validation_1.Joi.forbidden().messages({
|
|
30
31
|
'any.unknown': 'Please use the new Docusaurus global trailingSlash config instead, and the sitemaps plugin will use it.',
|
|
31
32
|
}),
|
|
33
|
+
filename: utils_validation_1.Joi.string().default(exports.DEFAULT_OPTIONS.filename),
|
|
32
34
|
});
|
|
33
35
|
function validateOptions({ validate, options, }) {
|
|
34
36
|
const validatedOptions = validate(PluginOptionSchema, options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-sitemap",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-5069",
|
|
4
4
|
"description": "Simple sitemap generation plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@docusaurus/core": "0.0.0-
|
|
22
|
-
"@docusaurus/logger": "0.0.0-
|
|
23
|
-
"@docusaurus/utils": "0.0.0-
|
|
24
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
25
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
21
|
+
"@docusaurus/core": "0.0.0-5069",
|
|
22
|
+
"@docusaurus/logger": "0.0.0-5069",
|
|
23
|
+
"@docusaurus/utils": "0.0.0-5069",
|
|
24
|
+
"@docusaurus/utils-common": "0.0.0-5069",
|
|
25
|
+
"@docusaurus/utils-validation": "0.0.0-5069",
|
|
26
26
|
"fs-extra": "^10.1.0",
|
|
27
27
|
"sitemap": "^7.1.1",
|
|
28
28
|
"tslib": "^2.4.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@docusaurus/types": "0.0.0-
|
|
31
|
+
"@docusaurus/types": "0.0.0-5069"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"react": "^16.8.4 || ^17.0.0",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=16.14"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "36ac2dff36395edb2f26a90bd6456bf0d7926279"
|
|
41
41
|
}
|
package/src/index.ts
CHANGED
|
@@ -32,7 +32,7 @@ export default function pluginSitemap(
|
|
|
32
32
|
);
|
|
33
33
|
|
|
34
34
|
// Write sitemap file.
|
|
35
|
-
const sitemapPath = path.join(outDir,
|
|
35
|
+
const sitemapPath = path.join(outDir, options.filename);
|
|
36
36
|
try {
|
|
37
37
|
await fs.outputFile(sitemapPath, generatedSitemap);
|
|
38
38
|
} catch (err) {
|
package/src/options.ts
CHANGED
|
@@ -19,6 +19,11 @@ export type PluginOptions = {
|
|
|
19
19
|
* sitemap. Note that you may need to include the base URL in here.
|
|
20
20
|
*/
|
|
21
21
|
ignorePatterns: string[];
|
|
22
|
+
/**
|
|
23
|
+
* The path to the created sitemap file, relative to the output directory.
|
|
24
|
+
* Useful if you have two plugin instances outputting two files.
|
|
25
|
+
*/
|
|
26
|
+
filename: string;
|
|
22
27
|
};
|
|
23
28
|
|
|
24
29
|
export type Options = Partial<PluginOptions>;
|
|
@@ -27,6 +32,7 @@ export const DEFAULT_OPTIONS: PluginOptions = {
|
|
|
27
32
|
changefreq: EnumChangefreq.WEEKLY,
|
|
28
33
|
priority: 0.5,
|
|
29
34
|
ignorePatterns: [],
|
|
35
|
+
filename: 'sitemap.xml',
|
|
30
36
|
};
|
|
31
37
|
|
|
32
38
|
const PluginOptionSchema = Joi.object<PluginOptions>({
|
|
@@ -46,6 +52,7 @@ const PluginOptionSchema = Joi.object<PluginOptions>({
|
|
|
46
52
|
'any.unknown':
|
|
47
53
|
'Please use the new Docusaurus global trailingSlash config instead, and the sitemaps plugin will use it.',
|
|
48
54
|
}),
|
|
55
|
+
filename: Joi.string().default(DEFAULT_OPTIONS.filename),
|
|
49
56
|
});
|
|
50
57
|
|
|
51
58
|
export function validateOptions({
|