@docusaurus/plugin-content-pages 4.0.0-canary-6885 → 4.0.0-canary-6891
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/content.js +2 -2
- package/lib/index.js +2 -2
- package/package.json +9 -9
- package/src/content.ts +1 -1
- package/src/index.ts +2 -2
package/lib/content.js
CHANGED
|
@@ -9,10 +9,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.createPagesContentPaths = createPagesContentPaths;
|
|
10
10
|
exports.loadPagesContent = loadPagesContent;
|
|
11
11
|
const tslib_1 = require("tslib");
|
|
12
|
-
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
13
12
|
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
14
13
|
const utils_1 = require("@docusaurus/utils");
|
|
15
14
|
const glob_1 = require("@docusaurus/glob");
|
|
15
|
+
const fs_1 = require("@docusaurus/fs");
|
|
16
16
|
const frontMatter_1 = require("./frontMatter");
|
|
17
17
|
function createPagesContentPaths({ context, options, }) {
|
|
18
18
|
const { siteDir, localizationDir } = context;
|
|
@@ -67,7 +67,7 @@ async function processPageSourceFile(relativeSource, params) {
|
|
|
67
67
|
source: aliasedSourcePath,
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
const content = await
|
|
70
|
+
const content = await fs_1.fs.readFile(source, 'utf-8');
|
|
71
71
|
const { frontMatter: unsafeFrontMatter, contentTitle, excerpt, } = await (0, utils_1.parseMarkdownFile)({
|
|
72
72
|
filePath: source,
|
|
73
73
|
fileContent: content,
|
package/lib/index.js
CHANGED
|
@@ -9,11 +9,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.validateOptions = void 0;
|
|
10
10
|
exports.default = pluginContentPages;
|
|
11
11
|
const tslib_1 = require("tslib");
|
|
12
|
-
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
13
12
|
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
14
13
|
const utils_1 = require("@docusaurus/utils");
|
|
15
14
|
const glob_1 = require("@docusaurus/glob");
|
|
16
15
|
const mdx_loader_1 = require("@docusaurus/mdx-loader");
|
|
16
|
+
const fs_1 = require("@docusaurus/fs");
|
|
17
17
|
const routes_1 = require("./routes");
|
|
18
18
|
const content_1 = require("./content");
|
|
19
19
|
const contentHelpers_1 = require("./contentHelpers");
|
|
@@ -71,7 +71,7 @@ function pluginContentPages(context, options) {
|
|
|
71
71
|
return (0, utils_1.getContentPathList)(contentPaths).flatMap((contentPath) => include.map((pattern) => `${contentPath}/${pattern}`));
|
|
72
72
|
},
|
|
73
73
|
async loadContent() {
|
|
74
|
-
if (!(await
|
|
74
|
+
if (!(await (0, fs_1.pathExists)(contentPaths.contentPath))) {
|
|
75
75
|
return null;
|
|
76
76
|
}
|
|
77
77
|
return (0, content_1.loadPagesContent)({ context, options, contentPaths });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-content-pages",
|
|
3
|
-
"version": "4.0.0-canary-
|
|
3
|
+
"version": "4.0.0-canary-6891",
|
|
4
4
|
"description": "Pages plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/plugin-content-pages.d.ts",
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@docusaurus/core": "4.0.0-canary-
|
|
22
|
-
"@docusaurus/
|
|
23
|
-
"@docusaurus/
|
|
24
|
-
"@docusaurus/
|
|
25
|
-
"@docusaurus/
|
|
26
|
-
"@docusaurus/utils
|
|
27
|
-
"
|
|
21
|
+
"@docusaurus/core": "4.0.0-canary-6891",
|
|
22
|
+
"@docusaurus/fs": "4.0.0-canary-6891",
|
|
23
|
+
"@docusaurus/glob": "4.0.0-canary-6891",
|
|
24
|
+
"@docusaurus/mdx-loader": "4.0.0-canary-6891",
|
|
25
|
+
"@docusaurus/types": "4.0.0-canary-6891",
|
|
26
|
+
"@docusaurus/utils": "4.0.0-canary-6891",
|
|
27
|
+
"@docusaurus/utils-validation": "4.0.0-canary-6891",
|
|
28
28
|
"tslib": "^2.8.1",
|
|
29
29
|
"webpack": "^5.111.0"
|
|
30
30
|
},
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"engines": {
|
|
36
36
|
"node": ">=24.21"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "f276aff972dcc432c037123c6d522e6c50881e79"
|
|
39
39
|
}
|
package/src/content.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import fs from 'fs-extra';
|
|
9
8
|
import path from 'node:path';
|
|
10
9
|
import {
|
|
11
10
|
encodePath,
|
|
@@ -25,6 +24,7 @@ import {
|
|
|
25
24
|
type ContentPaths,
|
|
26
25
|
} from '@docusaurus/utils';
|
|
27
26
|
import {glob} from '@docusaurus/glob';
|
|
27
|
+
import {fs} from '@docusaurus/fs';
|
|
28
28
|
import {validatePageFrontMatter} from './frontMatter';
|
|
29
29
|
import type {LoadContext} from '@docusaurus/types';
|
|
30
30
|
import type {
|
package/src/index.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import fs from 'fs-extra';
|
|
9
8
|
import path from 'node:path';
|
|
10
9
|
import {
|
|
11
10
|
aliasedSitePath,
|
|
@@ -16,6 +15,7 @@ import {
|
|
|
16
15
|
} from '@docusaurus/utils';
|
|
17
16
|
import {createAbsoluteFilePathMatcher} from '@docusaurus/glob';
|
|
18
17
|
import {createMDXLoaderRule} from '@docusaurus/mdx-loader';
|
|
18
|
+
import {pathExists} from '@docusaurus/fs';
|
|
19
19
|
import {createAllRoutes} from './routes';
|
|
20
20
|
import {createPagesContentPaths, loadPagesContent} from './content';
|
|
21
21
|
import {createContentHelpers} from './contentHelpers';
|
|
@@ -109,7 +109,7 @@ export default function pluginContentPages(
|
|
|
109
109
|
},
|
|
110
110
|
|
|
111
111
|
async loadContent() {
|
|
112
|
-
if (!(await
|
|
112
|
+
if (!(await pathExists(contentPaths.contentPath))) {
|
|
113
113
|
return null;
|
|
114
114
|
}
|
|
115
115
|
return loadPagesContent({context, options, contentPaths});
|