mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-05 04:12:53 +02:00
feat(v2): support external links and linking to docs from other sidebars (#1052)
* feat(sidebar): support external links and linking to docs from other sidebars * Update styles.css
This commit is contained in:
parent
edde297504
commit
a2d3f26722
8 changed files with 466 additions and 139 deletions
32
v2/lib/theme/Sidebar/SidebarCategory.js
Normal file
32
v2/lib/theme/Sidebar/SidebarCategory.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
|
||||
import styles from './styles.css';
|
||||
|
||||
export default function SidebarCategory({
|
||||
label,
|
||||
items,
|
||||
subCategory,
|
||||
renderItem,
|
||||
}) {
|
||||
const Heading = subCategory ? 'h4' : 'h3';
|
||||
|
||||
return (
|
||||
<div
|
||||
className={classnames(styles.sidebarGroup, {
|
||||
[styles.sidebarSubGroup]: subCategory,
|
||||
})}
|
||||
key={label}>
|
||||
<Heading
|
||||
className={classnames(
|
||||
styles.sidebarItem,
|
||||
styles.sidebarGroupTitle,
|
||||
styles.sidebarGroupCategoryTitle,
|
||||
)}>
|
||||
{label}
|
||||
</Heading>
|
||||
|
||||
<ul className={styles.sidebarList}>{items.map(renderItem)}</ul>
|
||||
</div>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue