@docusaurus/plugin-content-docs 0.0.0-5894 → 0.0.0-5898

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.
@@ -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): PropNavigationLink;
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;
@@ -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 { title: paginationLabel ?? sidebarLabel ?? title, permalink };
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-5894",
3
+ "version": "0.0.0-5898",
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-5894",
39
- "@docusaurus/logger": "0.0.0-5894",
40
- "@docusaurus/mdx-loader": "0.0.0-5894",
41
- "@docusaurus/module-type-aliases": "0.0.0-5894",
42
- "@docusaurus/types": "0.0.0-5894",
43
- "@docusaurus/utils": "0.0.0-5894",
44
- "@docusaurus/utils-common": "0.0.0-5894",
45
- "@docusaurus/utils-validation": "0.0.0-5894",
38
+ "@docusaurus/core": "0.0.0-5898",
39
+ "@docusaurus/logger": "0.0.0-5898",
40
+ "@docusaurus/mdx-loader": "0.0.0-5898",
41
+ "@docusaurus/module-type-aliases": "0.0.0-5898",
42
+ "@docusaurus/types": "0.0.0-5898",
43
+ "@docusaurus/utils": "0.0.0-5898",
44
+ "@docusaurus/utils-common": "0.0.0-5898",
45
+ "@docusaurus/utils-validation": "0.0.0-5898",
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": "002e325935f110e1f4142478b71b62ba21318bd5"
69
+ "gitHead": "9ae3e7f8841dc5ae7c07b084c48c1e80d4d355fe"
70
70
  }
@@ -478,7 +478,10 @@ Available document ids are:
478
478
  };
479
479
  }
480
480
 
481
- export function toDocNavigationLink(doc: DocMetadataBase): PropNavigationLink {
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 {title: paginationLabel ?? sidebarLabel ?? title, permalink};
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
  }