mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-01 00:48:02 +02:00
feat(content-docs): sidebar item type "html" for rendering pure markup (#6519)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
65ba551f5b
commit
6ec0db4722
9 changed files with 172 additions and 3 deletions
|
@ -123,12 +123,13 @@ export function findFirstCategoryLink(
|
|||
for (const subItem of item.items) {
|
||||
if (subItem.type === 'link') {
|
||||
return subItem.href;
|
||||
}
|
||||
if (subItem.type === 'category') {
|
||||
} else if (subItem.type === 'category') {
|
||||
const categoryLink = findFirstCategoryLink(subItem);
|
||||
if (categoryLink) {
|
||||
return categoryLink;
|
||||
}
|
||||
} else if (subItem.type === 'html') {
|
||||
// skip
|
||||
} else {
|
||||
throw new Error(
|
||||
`Unexpected category item type for ${JSON.stringify(subItem)}`,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue