mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 00:27:21 +02:00
Allow document not in sidebar.json to be displayed
This commit is contained in:
parent
3eb667cd32
commit
09ca732402
2 changed files with 16 additions and 10 deletions
|
@ -18,6 +18,10 @@ class DocsSidebar extends React.Component {
|
|||
render() {
|
||||
let sidebar = this.props.metadata.sidebar;
|
||||
let docsCategories = readCategories(sidebar);
|
||||
const categoryName = docsCategories[this.props.metadata.language][0].name;
|
||||
if (!categoryName) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<Container className="docsNavContainer" id="docsNav" wrapper={false}>
|
||||
<SideNav
|
||||
|
|
|
@ -123,6 +123,7 @@ function processMetadata(file) {
|
|||
const order = readSidebar();
|
||||
const id = metadata.localized_id;
|
||||
|
||||
if (order[id]) {
|
||||
metadata.sidebar = order[id].sidebar;
|
||||
metadata.category = order[id].category;
|
||||
|
||||
|
@ -134,6 +135,7 @@ function processMetadata(file) {
|
|||
metadata.previous_id = order[id].previous;
|
||||
metadata.previous = language + "-" + order[id].previous;
|
||||
}
|
||||
}
|
||||
|
||||
return { metadata, rawContent: rawContent };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue