@docusaurus/plugin-content-docs 3.8.1-canary-6348 → 3.8.1-canary-6350
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/props.js +5 -4
- package/lib/sidebars/postProcessor.js +4 -1
- package/package.json +11 -11
- package/src/props.ts +5 -13
- package/src/sidebars/postProcessor.ts +4 -1
package/lib/props.js
CHANGED
|
@@ -15,13 +15,14 @@ const tslib_1 = require("tslib");
|
|
|
15
15
|
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
16
16
|
const docs_1 = require("./docs");
|
|
17
17
|
function toSidebarDocItemLinkProp({ item, doc, }) {
|
|
18
|
-
const { id, title, permalink, frontMatter
|
|
18
|
+
const { id, title, permalink, frontMatter, unlisted } = doc;
|
|
19
19
|
return {
|
|
20
20
|
type: 'link',
|
|
21
|
-
label: sidebarLabel ?? item.label ?? title,
|
|
22
21
|
href: permalink,
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
// Front Matter data takes precedence over sidebars.json
|
|
23
|
+
label: frontMatter.sidebar_label ?? item.label ?? title,
|
|
24
|
+
className: frontMatter.sidebar_class_name ?? item.className,
|
|
25
|
+
customProps: frontMatter.sidebar_custom_props ?? item.customProps,
|
|
25
26
|
docId: id,
|
|
26
27
|
unlisted,
|
|
27
28
|
};
|
|
@@ -53,10 +53,13 @@ function postProcessSidebarItem(item, params) {
|
|
|
53
53
|
params.draftIds.has(category.link.id)) {
|
|
54
54
|
return null;
|
|
55
55
|
}
|
|
56
|
+
const { label, className, customProps } = category;
|
|
56
57
|
return {
|
|
57
58
|
type: 'doc',
|
|
58
|
-
label: category.label,
|
|
59
59
|
id: category.link.id,
|
|
60
|
+
label,
|
|
61
|
+
...(className && { className }),
|
|
62
|
+
...(customProps && { customProps }),
|
|
60
63
|
};
|
|
61
64
|
}
|
|
62
65
|
// A non-collapsible category can't be collapsed!
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-content-docs",
|
|
3
|
-
"version": "3.8.1-canary-
|
|
3
|
+
"version": "3.8.1-canary-6350",
|
|
4
4
|
"description": "Docs plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
},
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@docusaurus/core": "3.8.1-canary-
|
|
39
|
-
"@docusaurus/logger": "3.8.1-canary-
|
|
40
|
-
"@docusaurus/mdx-loader": "3.8.1-canary-
|
|
41
|
-
"@docusaurus/module-type-aliases": "3.8.1-canary-
|
|
42
|
-
"@docusaurus/theme-common": "3.8.1-canary-
|
|
43
|
-
"@docusaurus/types": "3.8.1-canary-
|
|
44
|
-
"@docusaurus/utils": "3.8.1-canary-
|
|
45
|
-
"@docusaurus/utils-common": "3.8.1-canary-
|
|
46
|
-
"@docusaurus/utils-validation": "3.8.1-canary-
|
|
38
|
+
"@docusaurus/core": "3.8.1-canary-6350",
|
|
39
|
+
"@docusaurus/logger": "3.8.1-canary-6350",
|
|
40
|
+
"@docusaurus/mdx-loader": "3.8.1-canary-6350",
|
|
41
|
+
"@docusaurus/module-type-aliases": "3.8.1-canary-6350",
|
|
42
|
+
"@docusaurus/theme-common": "3.8.1-canary-6350",
|
|
43
|
+
"@docusaurus/types": "3.8.1-canary-6350",
|
|
44
|
+
"@docusaurus/utils": "3.8.1-canary-6350",
|
|
45
|
+
"@docusaurus/utils-common": "3.8.1-canary-6350",
|
|
46
|
+
"@docusaurus/utils-validation": "3.8.1-canary-6350",
|
|
47
47
|
"@types/react-router-config": "^5.0.7",
|
|
48
48
|
"combine-promises": "^1.1.0",
|
|
49
49
|
"fs-extra": "^11.1.1",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"engines": {
|
|
68
68
|
"node": ">=18.0"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "76f391c678f4d51cad345f9ac4bd53a1b44b7f90"
|
|
71
71
|
}
|
package/src/props.ts
CHANGED
|
@@ -38,22 +38,14 @@ export function toSidebarDocItemLinkProp({
|
|
|
38
38
|
'id' | 'title' | 'permalink' | 'unlisted' | 'frontMatter'
|
|
39
39
|
>;
|
|
40
40
|
}): PropSidebarItemLink {
|
|
41
|
-
const {
|
|
42
|
-
id,
|
|
43
|
-
title,
|
|
44
|
-
permalink,
|
|
45
|
-
frontMatter: {
|
|
46
|
-
sidebar_label: sidebarLabel,
|
|
47
|
-
sidebar_custom_props: customProps,
|
|
48
|
-
},
|
|
49
|
-
unlisted,
|
|
50
|
-
} = doc;
|
|
41
|
+
const {id, title, permalink, frontMatter, unlisted} = doc;
|
|
51
42
|
return {
|
|
52
43
|
type: 'link',
|
|
53
|
-
label: sidebarLabel ?? item.label ?? title,
|
|
54
44
|
href: permalink,
|
|
55
|
-
|
|
56
|
-
|
|
45
|
+
// Front Matter data takes precedence over sidebars.json
|
|
46
|
+
label: frontMatter.sidebar_label ?? item.label ?? title,
|
|
47
|
+
className: frontMatter.sidebar_class_name ?? item.className,
|
|
48
|
+
customProps: frontMatter.sidebar_custom_props ?? item.customProps,
|
|
57
49
|
docId: id,
|
|
58
50
|
unlisted,
|
|
59
51
|
};
|
|
@@ -77,10 +77,13 @@ function postProcessSidebarItem(
|
|
|
77
77
|
) {
|
|
78
78
|
return null;
|
|
79
79
|
}
|
|
80
|
+
const {label, className, customProps} = category;
|
|
80
81
|
return {
|
|
81
82
|
type: 'doc',
|
|
82
|
-
label: category.label,
|
|
83
83
|
id: category.link.id,
|
|
84
|
+
label,
|
|
85
|
+
...(className && {className}),
|
|
86
|
+
...(customProps && {customProps}),
|
|
84
87
|
};
|
|
85
88
|
}
|
|
86
89
|
// A non-collapsible category can't be collapsed!
|