mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 16:47:26 +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() {
|
render() {
|
||||||
let sidebar = this.props.metadata.sidebar;
|
let sidebar = this.props.metadata.sidebar;
|
||||||
let docsCategories = readCategories(sidebar);
|
let docsCategories = readCategories(sidebar);
|
||||||
|
const categoryName = docsCategories[this.props.metadata.language][0].name;
|
||||||
|
if (!categoryName) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<Container className="docsNavContainer" id="docsNav" wrapper={false}>
|
<Container className="docsNavContainer" id="docsNav" wrapper={false}>
|
||||||
<SideNav
|
<SideNav
|
||||||
|
|
|
@ -123,16 +123,18 @@ function processMetadata(file) {
|
||||||
const order = readSidebar();
|
const order = readSidebar();
|
||||||
const id = metadata.localized_id;
|
const id = metadata.localized_id;
|
||||||
|
|
||||||
metadata.sidebar = order[id].sidebar;
|
if (order[id]) {
|
||||||
metadata.category = order[id].category;
|
metadata.sidebar = order[id].sidebar;
|
||||||
|
metadata.category = order[id].category;
|
||||||
|
|
||||||
if (order[id].next) {
|
if (order[id].next) {
|
||||||
metadata.next_id = order[id].next;
|
metadata.next_id = order[id].next;
|
||||||
metadata.next = language + "-" + order[id].next;
|
metadata.next = language + "-" + order[id].next;
|
||||||
}
|
}
|
||||||
if (order[id].previous) {
|
if (order[id].previous) {
|
||||||
metadata.previous_id = order[id].previous;
|
metadata.previous_id = order[id].previous;
|
||||||
metadata.previous = language + "-" + order[id].previous;
|
metadata.previous = language + "-" + order[id].previous;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return { metadata, rawContent: rawContent };
|
return { metadata, rawContent: rawContent };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue