mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-31 07:18:59 +02:00
feat(content-docs): add support for sidebar item category/link descriptions in generated index page (#8236)
Co-authored-by: Davide Donadio <davide.donadio@it.clara.net> Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
ca86fab2c9
commit
5c271f5622
6 changed files with 67 additions and 11 deletions
|
@ -85,6 +85,7 @@ type SidebarItemLink = {
|
|||
label: string;
|
||||
href: string;
|
||||
className?: string;
|
||||
description?: string;
|
||||
};
|
||||
```
|
||||
|
||||
|
@ -173,6 +174,7 @@ type SidebarItemCategory = {
|
|||
label: string; // Sidebar label text.
|
||||
items: SidebarItem[]; // Array of sidebar items.
|
||||
className?: string;
|
||||
description?: string;
|
||||
|
||||
// Category options:
|
||||
collapsible: boolean; // Set the category to be collapsible
|
||||
|
|
|
@ -116,7 +116,7 @@ The pagination label by default is the sidebar label. You can use the front matt
|
|||
|
||||
## The `ref` item {#sidebar-item-ref}
|
||||
|
||||
The `ref` type is identical to the [`doc` type](#sidebar-item-doc) in every way, except that it doesn't participate in generating navigation metadata. It only registers itself as a link. When [generating pagination](#generating-pagination) and [displaying sidebar](#sidebar-association), `ref` items are completely ignored.
|
||||
The `ref` type is identical to the [`doc` type](./items.mdx#sidebar-item-doc) in every way, except that it doesn't participate in generating navigation metadata. It only registers itself as a link. When [generating pagination](#generating-pagination) and [displaying sidebar](#sidebar-association), `ref` items are completely ignored.
|
||||
|
||||
It is particularly useful where you wish to link to the same document from multiple sidebars. The document only belongs to one sidebar (the one where it's registered as `type: 'doc'` or from an autogenerated directory), but its link will appear in all sidebars that it's registered in.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue