-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate documentation from old website (#9)
- Loading branch information
Showing
556 changed files
with
30,328 additions
and
32 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Fragment } from 'react'; | ||
import DocCardList, { type Props as DocCardListProps } from '@theme/DocCardList'; | ||
import { useCurrentSidebarCategory } from '@docusaurus/theme-common'; | ||
import { PropSidebarItem, PropSidebarItemCategory } from '@docusaurus/plugin-content-docs'; | ||
import Heading, { type HeadingType } from '@theme/Heading'; | ||
|
||
export interface Props extends Omit<DocCardListProps, 'items'> { | ||
headingLevel?: HeadingType; | ||
} | ||
|
||
function isCategory(item: PropSidebarItem): item is PropSidebarItemCategory { | ||
return item.type === 'category'; | ||
} | ||
|
||
export default function SubcategoryDocCardList({ headingLevel, ...props }: Props) { | ||
const category = useCurrentSidebarCategory(); | ||
const subcategories = category.items.filter(isCategory); | ||
return subcategories.map((subcategory) => ( | ||
<Fragment key={subcategory.label}> | ||
<Heading as={headingLevel ?? 'h2'}>{subcategory.label}</Heading> | ||
<DocCardList items={subcategory.items} {...props} /> | ||
</Fragment> | ||
)); | ||
} |
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
Oops, something went wrong.