-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Labels
featureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Description
when construct a category, if exiting README.md like found, use the doc's title and sidebar label for category
docusaurus/packages/docusaurus-plugin-content-docs/src/sidebars/generator.ts
Lines 235 to 257 in 9f0809a
| const link: SidebarItemCategoryLink | undefined = categoryLinkedDocId | |
| ? { | |
| type: 'doc', | |
| id: categoryLinkedDocId, // We "remap" a potentially "local id" to a "qualified id" | |
| } | |
| : // TODO typing issue | |
| (categoryMetadata?.link as SidebarItemCategoryLink | undefined); | |
| // If a doc is linked, remove it from the category subItems | |
| const items = allItems.filter( | |
| (item) => !(item.type === 'doc' && item.id === categoryLinkedDocId), | |
| ); | |
| return { | |
| type: 'category', | |
| label: categoryMetadata?.label ?? filename, | |
| collapsible: | |
| categoryMetadata?.collapsible ?? options.sidebarCollapsible, | |
| collapsed: categoryMetadata?.collapsed ?? options.sidebarCollapsed, | |
| position: categoryMetadata?.position ?? numberPrefix, | |
| ...(className !== undefined && {className}), | |
| items, | |
| ...(link && {link}), |
Has this been requested on Canny?
No response
Motivation
migrate old self gen behavior to newer auto gen, but the auto gen require defined category metadata, there are toooo many, just use the README.md or index.md as category's metadata if not found
API design
No response
Have you tried building it?
No response
Self-service
- I'd be willing to contribute this feature to Docusaurus myself.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.This is not a bug or issue with Docusausus, per se. It is a feature request for the future.