@docusaurus/plugin-content-docs 0.0.0-5894 → 0.0.0-5899
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/sidebars/utils.d.ts +3 -1
- package/lib/sidebars/utils.js +8 -3
- package/package.json +10 -10
- package/src/sidebars/utils.ts +12 -3
package/lib/sidebars/utils.d.ts
CHANGED
|
@@ -61,7 +61,9 @@ export type SidebarsUtils = {
|
|
|
61
61
|
}) => void;
|
|
62
62
|
};
|
|
63
63
|
export declare function createSidebarsUtils(sidebars: Sidebars): SidebarsUtils;
|
|
64
|
-
export declare function toDocNavigationLink(doc: DocMetadataBase
|
|
64
|
+
export declare function toDocNavigationLink(doc: DocMetadataBase, options?: {
|
|
65
|
+
sidebarItemLabel?: string | undefined;
|
|
66
|
+
}): PropNavigationLink;
|
|
65
67
|
export declare function toNavigationLink(navigationItem: SidebarNavigationItem | undefined, docsById: {
|
|
66
68
|
[docId: string]: DocMetadataBase;
|
|
67
69
|
}): PropNavigationLink | undefined;
|
package/lib/sidebars/utils.js
CHANGED
|
@@ -294,9 +294,12 @@ Available document ids are:
|
|
|
294
294
|
};
|
|
295
295
|
}
|
|
296
296
|
exports.createSidebarsUtils = createSidebarsUtils;
|
|
297
|
-
function toDocNavigationLink(doc) {
|
|
297
|
+
function toDocNavigationLink(doc, options) {
|
|
298
298
|
const { title, permalink, frontMatter: { pagination_label: paginationLabel, sidebar_label: sidebarLabel, }, } = doc;
|
|
299
|
-
return {
|
|
299
|
+
return {
|
|
300
|
+
title: paginationLabel ?? sidebarLabel ?? options?.sidebarItemLabel ?? title,
|
|
301
|
+
permalink,
|
|
302
|
+
};
|
|
300
303
|
}
|
|
301
304
|
exports.toDocNavigationLink = toDocNavigationLink;
|
|
302
305
|
function toNavigationLink(navigationItem, docsById) {
|
|
@@ -318,6 +321,8 @@ function toNavigationLink(navigationItem, docsById) {
|
|
|
318
321
|
permalink: navigationItem.link.permalink,
|
|
319
322
|
};
|
|
320
323
|
}
|
|
321
|
-
return toDocNavigationLink(getDocById(navigationItem.id)
|
|
324
|
+
return toDocNavigationLink(getDocById(navigationItem.id), {
|
|
325
|
+
sidebarItemLabel: navigationItem?.label,
|
|
326
|
+
});
|
|
322
327
|
}
|
|
323
328
|
exports.toNavigationLink = toNavigationLink;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-content-docs",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-5899",
|
|
4
4
|
"description": "Docs plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
},
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@docusaurus/core": "0.0.0-
|
|
39
|
-
"@docusaurus/logger": "0.0.0-
|
|
40
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
41
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
42
|
-
"@docusaurus/types": "0.0.0-
|
|
43
|
-
"@docusaurus/utils": "0.0.0-
|
|
44
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
45
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
38
|
+
"@docusaurus/core": "0.0.0-5899",
|
|
39
|
+
"@docusaurus/logger": "0.0.0-5899",
|
|
40
|
+
"@docusaurus/mdx-loader": "0.0.0-5899",
|
|
41
|
+
"@docusaurus/module-type-aliases": "0.0.0-5899",
|
|
42
|
+
"@docusaurus/types": "0.0.0-5899",
|
|
43
|
+
"@docusaurus/utils": "0.0.0-5899",
|
|
44
|
+
"@docusaurus/utils-common": "0.0.0-5899",
|
|
45
|
+
"@docusaurus/utils-validation": "0.0.0-5899",
|
|
46
46
|
"@types/react-router-config": "^5.0.7",
|
|
47
47
|
"combine-promises": "^1.1.0",
|
|
48
48
|
"fs-extra": "^11.1.1",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"engines": {
|
|
67
67
|
"node": ">=18.0"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "e8e1f914293e8dade7f4e0907d9a00bd1df80470"
|
|
70
70
|
}
|
package/src/sidebars/utils.ts
CHANGED
|
@@ -478,7 +478,10 @@ Available document ids are:
|
|
|
478
478
|
};
|
|
479
479
|
}
|
|
480
480
|
|
|
481
|
-
export function toDocNavigationLink(
|
|
481
|
+
export function toDocNavigationLink(
|
|
482
|
+
doc: DocMetadataBase,
|
|
483
|
+
options?: {sidebarItemLabel?: string | undefined},
|
|
484
|
+
): PropNavigationLink {
|
|
482
485
|
const {
|
|
483
486
|
title,
|
|
484
487
|
permalink,
|
|
@@ -487,7 +490,11 @@ export function toDocNavigationLink(doc: DocMetadataBase): PropNavigationLink {
|
|
|
487
490
|
sidebar_label: sidebarLabel,
|
|
488
491
|
},
|
|
489
492
|
} = doc;
|
|
490
|
-
return {
|
|
493
|
+
return {
|
|
494
|
+
title:
|
|
495
|
+
paginationLabel ?? sidebarLabel ?? options?.sidebarItemLabel ?? title,
|
|
496
|
+
permalink,
|
|
497
|
+
};
|
|
491
498
|
}
|
|
492
499
|
|
|
493
500
|
export function toNavigationLink(
|
|
@@ -516,5 +523,7 @@ export function toNavigationLink(
|
|
|
516
523
|
permalink: navigationItem.link.permalink,
|
|
517
524
|
};
|
|
518
525
|
}
|
|
519
|
-
return toDocNavigationLink(getDocById(navigationItem.id)
|
|
526
|
+
return toDocNavigationLink(getDocById(navigationItem.id), {
|
|
527
|
+
sidebarItemLabel: navigationItem?.label,
|
|
528
|
+
});
|
|
520
529
|
}
|