@docusaurus/plugin-content-pages 2.0.0-beta.16 → 2.0.0-beta.17

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.
Files changed (2) hide show
  1. package/lib/index.js +6 -8
  2. package/package.json +7 -7
package/lib/index.js CHANGED
@@ -8,10 +8,10 @@
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 fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
12
- const path_1 = (0, tslib_1.__importDefault)(require("path"));
11
+ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
12
+ const path_1 = tslib_1.__importDefault(require("path"));
13
13
  const utils_1 = require("@docusaurus/utils");
14
- const remark_admonitions_1 = (0, tslib_1.__importDefault)(require("remark-admonitions"));
14
+ const remark_admonitions_1 = tslib_1.__importDefault(require("remark-admonitions"));
15
15
  const pluginOptionSchema_1 = require("./pluginOptionSchema");
16
16
  const pageFrontMatter_1 = require("./pageFrontMatter");
17
17
  function getContentPathList(contentPaths) {
@@ -20,7 +20,6 @@ function getContentPathList(contentPaths) {
20
20
  exports.getContentPathList = getContentPathList;
21
21
  const isMarkdownSource = (source) => source.endsWith('.md') || source.endsWith('.mdx');
22
22
  async function pluginContentPages(context, options) {
23
- var _a;
24
23
  if (options.admonitions) {
25
24
  options.remarkPlugins = options.remarkPlugins.concat([
26
25
  [remark_admonitions_1.default, options.admonitions || {}],
@@ -37,7 +36,7 @@ async function pluginContentPages(context, options) {
37
36
  }),
38
37
  };
39
38
  const pluginDataDirRoot = path_1.default.join(generatedFilesDir, 'docusaurus-plugin-content-pages');
40
- const dataDir = path_1.default.join(pluginDataDirRoot, (_a = options.id) !== null && _a !== void 0 ? _a : utils_1.DEFAULT_PLUGIN_ID);
39
+ const dataDir = path_1.default.join(pluginDataDirRoot, options.id ?? utils_1.DEFAULT_PLUGIN_ID);
41
40
  return {
42
41
  name: 'docusaurus-plugin-content-pages',
43
42
  getPathsToWatch() {
@@ -55,7 +54,6 @@ async function pluginContentPages(context, options) {
55
54
  ignore: options.exclude,
56
55
  });
57
56
  async function toMetadata(relativeSource) {
58
- var _a, _b;
59
57
  // Lookup in localized folder in priority
60
58
  const contentPath = await (0, utils_1.getFolderContainingFile)(getContentPathList(contentPaths), relativeSource);
61
59
  const source = path_1.default.join(contentPath, relativeSource);
@@ -79,8 +77,8 @@ async function pluginContentPages(context, options) {
79
77
  type: 'mdx',
80
78
  permalink,
81
79
  source: aliasedSourcePath,
82
- title: (_a = frontMatter.title) !== null && _a !== void 0 ? _a : contentTitle,
83
- description: (_b = frontMatter.description) !== null && _b !== void 0 ? _b : excerpt,
80
+ title: frontMatter.title ?? contentTitle,
81
+ description: frontMatter.description ?? excerpt,
84
82
  frontMatter,
85
83
  };
86
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/plugin-content-pages",
3
- "version": "2.0.0-beta.16",
3
+ "version": "2.0.0-beta.17",
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,17 @@
18
18
  },
19
19
  "license": "MIT",
20
20
  "dependencies": {
21
- "@docusaurus/core": "2.0.0-beta.16",
22
- "@docusaurus/mdx-loader": "2.0.0-beta.16",
23
- "@docusaurus/utils": "2.0.0-beta.16",
24
- "@docusaurus/utils-validation": "2.0.0-beta.16",
21
+ "@docusaurus/core": "2.0.0-beta.17",
22
+ "@docusaurus/mdx-loader": "2.0.0-beta.17",
23
+ "@docusaurus/utils": "2.0.0-beta.17",
24
+ "@docusaurus/utils-validation": "2.0.0-beta.17",
25
25
  "fs-extra": "^10.0.1",
26
26
  "remark-admonitions": "^1.2.1",
27
27
  "tslib": "^2.3.1",
28
28
  "webpack": "^5.69.1"
29
29
  },
30
30
  "devDependencies": {
31
- "@docusaurus/types": "2.0.0-beta.16"
31
+ "@docusaurus/types": "2.0.0-beta.17"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "react": "^16.8.4 || ^17.0.0",
@@ -37,5 +37,5 @@
37
37
  "engines": {
38
38
  "node": ">=14"
39
39
  },
40
- "gitHead": "eb43c4d4f95a4fb97dc9bb9dc615413e0dc2e1e7"
40
+ "gitHead": "0032c0b0480083227af2e1b4da2d3ee6ce992403"
41
41
  }