Last active
March 14, 2024 18:36
-
-
Save isorna/aaec0f1fbba2b7701eaa8359a1fff0cd to your computer and use it in GitHub Desktop.
Auto generate Vitepress sidebars using front-matter for link text and ordering
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type SidebarItem = { | |
/** | |
* The text label of the item. | |
*/ | |
text?: string | |
/** | |
* The link of the item. | |
*/ | |
link?: string | |
/** | |
* The children of the item. | |
*/ | |
items?: SidebarItem[] | |
/** | |
* If not specified, group is not collapsible. | |
* | |
* If `true`, group is collapsible and collapsed by default | |
* | |
* If `false`, group is collapsible but expanded by default | |
*/ | |
collapsed?: boolean | |
/** | |
* Position order in the sidebar. | |
* | |
* /docs/[lang]/[system]/index.md should be equal to 0. | |
* | |
* /docs/[lang]/[system]/[folder]/index.md should be equal to its position under [system] folder. | |
*/ | |
position?: number | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment