@docusaurus/plugin-content-pages 0.0.0-4309 → 0.0.0-4317
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.d.ts +1 -1
- package/lib/index.js +3 -3
- package/package.json +8 -7
- package/src/index.ts +4 -4
package/lib/index.d.ts
CHANGED
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
import { LoadContext, Plugin, OptionValidationContext, ValidationResult } from '@docusaurus/types';
|
|
8
8
|
import { PluginOptions, LoadedContent, PagesContentPaths } from './types';
|
|
9
9
|
export declare function getContentPathList(contentPaths: PagesContentPaths): string[];
|
|
10
|
-
export default function pluginContentPages(context: LoadContext, options: PluginOptions): Plugin<LoadedContent | null
|
|
10
|
+
export default function pluginContentPages(context: LoadContext, options: PluginOptions): Promise<Plugin<LoadedContent | null>>;
|
|
11
11
|
export declare function validateOptions({ validate, options, }: OptionValidationContext<PluginOptions>): ValidationResult<PluginOptions>;
|
package/lib/index.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.validateOptions = exports.getContentPathList = void 0;
|
|
10
10
|
const tslib_1 = require("tslib");
|
|
11
|
-
const
|
|
11
|
+
const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
|
|
12
12
|
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
13
13
|
const utils_1 = require("@docusaurus/utils");
|
|
14
14
|
const remark_admonitions_1 = (0, tslib_1.__importDefault)(require("remark-admonitions"));
|
|
@@ -18,7 +18,7 @@ function getContentPathList(contentPaths) {
|
|
|
18
18
|
}
|
|
19
19
|
exports.getContentPathList = getContentPathList;
|
|
20
20
|
const isMarkdownSource = (source) => source.endsWith('.md') || source.endsWith('.mdx');
|
|
21
|
-
function pluginContentPages(context, options) {
|
|
21
|
+
async function pluginContentPages(context, options) {
|
|
22
22
|
var _a;
|
|
23
23
|
if (options.admonitions) {
|
|
24
24
|
options.remarkPlugins = options.remarkPlugins.concat([
|
|
@@ -45,7 +45,7 @@ function pluginContentPages(context, options) {
|
|
|
45
45
|
},
|
|
46
46
|
async loadContent() {
|
|
47
47
|
const { include } = options;
|
|
48
|
-
if (!
|
|
48
|
+
if (!(await fs_extra_1.default.pathExists(contentPaths.contentPath))) {
|
|
49
49
|
return null;
|
|
50
50
|
}
|
|
51
51
|
const { baseUrl } = siteConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-content-pages",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-4317",
|
|
4
4
|
"description": "Pages plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/plugin-content-pages.d.ts",
|
|
@@ -18,17 +18,18 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@docusaurus/core": "0.0.0-
|
|
22
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
23
|
-
"@docusaurus/utils": "0.0.0-
|
|
24
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
21
|
+
"@docusaurus/core": "0.0.0-4317",
|
|
22
|
+
"@docusaurus/mdx-loader": "0.0.0-4317",
|
|
23
|
+
"@docusaurus/utils": "0.0.0-4317",
|
|
24
|
+
"@docusaurus/utils-validation": "0.0.0-4317",
|
|
25
|
+
"fs-extra": "^10.0.0",
|
|
25
26
|
"globby": "^11.0.2",
|
|
26
27
|
"remark-admonitions": "^1.2.1",
|
|
27
28
|
"tslib": "^2.3.1",
|
|
28
29
|
"webpack": "^5.61.0"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
|
-
"@docusaurus/types": "0.0.0-
|
|
32
|
+
"@docusaurus/types": "0.0.0-4317"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
34
35
|
"react": "^16.8.4 || ^17.0.0",
|
|
@@ -37,5 +38,5 @@
|
|
|
37
38
|
"engines": {
|
|
38
39
|
"node": ">=14"
|
|
39
40
|
},
|
|
40
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "2bb530c3c0e21f46fba7df4a7abe529480a24b22"
|
|
41
42
|
}
|
package/src/index.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import fs from 'fs';
|
|
8
|
+
import fs from 'fs-extra';
|
|
9
9
|
import path from 'path';
|
|
10
10
|
import {
|
|
11
11
|
encodePath,
|
|
@@ -45,10 +45,10 @@ export function getContentPathList(contentPaths: PagesContentPaths): string[] {
|
|
|
45
45
|
const isMarkdownSource = (source: string) =>
|
|
46
46
|
source.endsWith('.md') || source.endsWith('.mdx');
|
|
47
47
|
|
|
48
|
-
export default function pluginContentPages(
|
|
48
|
+
export default async function pluginContentPages(
|
|
49
49
|
context: LoadContext,
|
|
50
50
|
options: PluginOptions,
|
|
51
|
-
): Plugin<LoadedContent | null
|
|
51
|
+
): Promise<Plugin<LoadedContent | null>> {
|
|
52
52
|
if (options.admonitions) {
|
|
53
53
|
options.remarkPlugins = options.remarkPlugins.concat([
|
|
54
54
|
[admonitions, options.admonitions || {}],
|
|
@@ -90,7 +90,7 @@ export default function pluginContentPages(
|
|
|
90
90
|
async loadContent() {
|
|
91
91
|
const {include} = options;
|
|
92
92
|
|
|
93
|
-
if (!fs.
|
|
93
|
+
if (!(await fs.pathExists(contentPaths.contentPath))) {
|
|
94
94
|
return null;
|
|
95
95
|
}
|
|
96
96
|
|