mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 02:08:55 +02:00
feat(content-docs): allow explicitly disabling index page for generated category (#6452)
* feat(content-docs): allow explicitly disabling index page for generated category * docs * add test
This commit is contained in:
parent
ffa108b58b
commit
3c58d7f027
7 changed files with 57 additions and 3 deletions
|
@ -45,7 +45,7 @@ export type CategoryMetadataFile = {
|
|||
collapsed?: boolean;
|
||||
collapsible?: boolean;
|
||||
className?: string;
|
||||
link?: SidebarItemCategoryLinkConfig;
|
||||
link?: SidebarItemCategoryLinkConfig | null;
|
||||
|
||||
// TODO should we allow "items" here? how would this work? would an "autogenerated" type be allowed?
|
||||
// This mkdocs plugin do something like that: https://github.com/lukasgeiter/mkdocs-awesome-pages-plugin/
|
||||
|
@ -222,8 +222,8 @@ export const DefaultSidebarItemsGenerator: SidebarItemsGenerator = async ({
|
|||
|
||||
function getCategoryLinkedDocId(): string | undefined {
|
||||
const link = categoryMetadata?.link;
|
||||
if (link) {
|
||||
if (link.type === 'doc') {
|
||||
if (link !== undefined) {
|
||||
if (link && link.type === 'doc') {
|
||||
return findDocByLocalId(link.id)?.id || getDoc(link.id).id;
|
||||
} else {
|
||||
// We don't continue for other link types on purpose!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue