Allow document not in sidebar.json to be displayed

This commit is contained in:
Frank Li 2017-08-07 15:15:09 -07:00
parent 3eb667cd32
commit 09ca732402
2 changed files with 16 additions and 10 deletions

View file

@ -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

View file

@ -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 };
}