@docusaurus/plugin-content-docs 0.0.0-4564 → 0.0.0-4565

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.
@@ -24,6 +24,7 @@ const DocFrontMatterSchema = utils_validation_1.JoiFrontMatter.object({
24
24
  sidebar_label: utils_validation_1.JoiFrontMatter.string(),
25
25
  sidebar_position: utils_validation_1.JoiFrontMatter.number(),
26
26
  sidebar_class_name: utils_validation_1.JoiFrontMatter.string(),
27
+ sidebar_custom_props: utils_validation_1.JoiFrontMatter.object().unknown(),
27
28
  displayed_sidebar: utils_validation_1.JoiFrontMatter.string().allow(null),
28
29
  tags: utils_validation_1.FrontMatterTagsSchema,
29
30
  pagination_label: utils_validation_1.JoiFrontMatter.string(),
package/lib/props.js CHANGED
@@ -21,6 +21,7 @@ Available document ids are:
21
21
  return docMetadata;
22
22
  }
23
23
  const convertDocLink = (item) => {
24
+ var _a;
24
25
  const docMetadata = getDocById(item.id);
25
26
  const { title, permalink, frontMatter: { sidebar_label: sidebarLabel }, } = docMetadata;
26
27
  return {
@@ -28,7 +29,7 @@ Available document ids are:
28
29
  label: sidebarLabel || item.label || title,
29
30
  href: permalink,
30
31
  className: item.className,
31
- customProps: item.customProps,
32
+ customProps: (_a = item.customProps) !== null && _a !== void 0 ? _a : docMetadata.frontMatter.sidebar_custom_props,
32
33
  docId: docMetadata.unversionedId,
33
34
  };
34
35
  };
package/lib/types.d.ts CHANGED
@@ -47,6 +47,7 @@ export declare type DocFrontMatter = {
47
47
  sidebar_label?: string;
48
48
  sidebar_position?: number;
49
49
  sidebar_class_name?: string;
50
+ sidebar_custom_props?: Record<string, unknown>;
50
51
  displayed_sidebar?: string | null;
51
52
  pagination_label?: string;
52
53
  custom_edit_url?: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/plugin-content-docs",
3
- "version": "0.0.0-4564",
3
+ "version": "0.0.0-4565",
4
4
  "description": "Docs plugin for Docusaurus.",
5
5
  "main": "lib/index.js",
6
6
  "exports": {
@@ -23,11 +23,11 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "dependencies": {
26
- "@docusaurus/core": "0.0.0-4564",
27
- "@docusaurus/logger": "0.0.0-4564",
28
- "@docusaurus/mdx-loader": "0.0.0-4564",
29
- "@docusaurus/utils": "0.0.0-4564",
30
- "@docusaurus/utils-validation": "0.0.0-4564",
26
+ "@docusaurus/core": "0.0.0-4565",
27
+ "@docusaurus/logger": "0.0.0-4565",
28
+ "@docusaurus/mdx-loader": "0.0.0-4565",
29
+ "@docusaurus/utils": "0.0.0-4565",
30
+ "@docusaurus/utils-validation": "0.0.0-4565",
31
31
  "combine-promises": "^1.1.0",
32
32
  "fs-extra": "^10.0.0",
33
33
  "import-fresh": "^3.2.2",
@@ -40,8 +40,8 @@
40
40
  "webpack": "^5.68.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@docusaurus/module-type-aliases": "0.0.0-4564",
44
- "@docusaurus/types": "0.0.0-4564",
43
+ "@docusaurus/module-type-aliases": "0.0.0-4565",
44
+ "@docusaurus/types": "0.0.0-4565",
45
45
  "@types/js-yaml": "^4.0.0",
46
46
  "@types/picomatch": "^2.2.1",
47
47
  "commander": "^5.1.0",
@@ -56,5 +56,5 @@
56
56
  "engines": {
57
57
  "node": ">=14"
58
58
  },
59
- "gitHead": "b1bfcd51a03aad7a8e55c55802fa62f79606b071"
59
+ "gitHead": "58480c4de1725cbcc30a12b6b73bd30ba6655b05"
60
60
  }
@@ -30,6 +30,7 @@ const DocFrontMatterSchema = Joi.object<DocFrontMatter>({
30
30
  sidebar_label: Joi.string(),
31
31
  sidebar_position: Joi.number(),
32
32
  sidebar_class_name: Joi.string(),
33
+ sidebar_custom_props: Joi.object().unknown(),
33
34
  displayed_sidebar: Joi.string().allow(null),
34
35
  tags: FrontMatterTagsSchema,
35
36
  pagination_label: Joi.string(),
package/src/props.ts CHANGED
@@ -52,7 +52,8 @@ Available document ids are:
52
52
  label: sidebarLabel || item.label || title,
53
53
  href: permalink,
54
54
  className: item.className,
55
- customProps: item.customProps,
55
+ customProps:
56
+ item.customProps ?? docMetadata.frontMatter.sidebar_custom_props,
56
57
  docId: docMetadata.unversionedId,
57
58
  };
58
59
  };
package/src/types.ts CHANGED
@@ -58,6 +58,7 @@ export type DocFrontMatter = {
58
58
  sidebar_label?: string;
59
59
  sidebar_position?: number;
60
60
  sidebar_class_name?: string;
61
+ sidebar_custom_props?: Record<string, unknown>;
61
62
  displayed_sidebar?: string | null;
62
63
  pagination_label?: string;
63
64
  custom_edit_url?: string | null;