mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-09 23:27:28 +02:00
Add ability to specify sub categories in sidebar.json (#891)
This commit is contained in:
parent
dd9d05c84d
commit
16087b4428
14 changed files with 534 additions and 87 deletions
|
@ -65,7 +65,22 @@ class SideNav extends React.Component {
|
|||
<h3 className="navGroupCategoryTitle">
|
||||
{this.getLocalizedCategoryString(category.name)}
|
||||
</h3>
|
||||
<ul>{category.links.map(this.renderItemLink, this)}</ul>
|
||||
<ul>
|
||||
{category.links.map(this.renderItemLink, this)}
|
||||
{category.sub_categories &&
|
||||
category.sub_categories.map(this.renderSubCategory, this)}
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
renderSubCategory(subCategory) {
|
||||
return (
|
||||
<div className="navGroup subNavGroup" key={subCategory.name}>
|
||||
<h4 className="navGroupSubCategoryTitle">
|
||||
{this.getLocalizedCategoryString(subCategory.name)}
|
||||
</h4>
|
||||
<ul>{subCategory.links.map(this.renderItemLink, this)}</ul>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue