docs: fix multiple sidebar code (#722) (#726)

pull/731/head
Divyansh Singh 3 years ago committed by GitHub
parent 1fe5153f47
commit 86690fa1ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -68,7 +68,7 @@ export default {
## Multiple Sidebars ## Multiple Sidebars
You may show different sidebar depending on the page path. For example, as shown on this site, you might want to create a separate sections of content in your documentation like "Guide" page and `Config` page. You may show different sidebar depending on the page path. For example, as shown on this site, you might want to create a separate sections of content in your documentation like "Guide" page and "Config" page.
To do so, first organize your pages into directories for each desired section: To do so, first organize your pages into directories for each desired section:
@ -92,27 +92,31 @@ export default {
sidebar: { sidebar: {
// This sidebar gets displayed when user is // This sidebar gets displayed when user is
// under `guide` directory. // under `guide` directory.
'/guide/': { '/guide/': [
text: 'Guide', {
items: [ text: 'Guide',
// This shows `/guide/index.md` page. items: [
{ text: 'Index', link: '/guide/' }, // /guide/index.md // This shows `/guide/index.md` page.
{ text: 'One', link: '/guide/one' }, // /guide/one.md { text: 'Index', link: '/guide/' }, // /guide/index.md
{ text: 'Two', link: '/guide/two' } // /guide/two.md { text: 'One', link: '/guide/one' }, // /guide/one.md
] { text: 'Two', link: '/guide/two' } // /guide/two.md
}, ]
}
],
// This sidebar gets displayed when user is // This sidebar gets displayed when user is
// under `config` directory. // under `config` directory.
'/config/': { '/config/': [
text: 'Config', {
items: [ text: 'Config',
// This shows `/guide/index.md` page. items: [
{ text: 'Index', link: '/config/' }, // /config/index.mdasdfasdfasdfasdfaf // This shows `/guide/index.md` page.
{ text: 'Three', link: '/config/three' }, // /config/three.md { text: 'Index', link: '/config/' }, // /config/index.md
{ text: 'Four', link: '/config/four' } // /config/four.md { text: 'Three', link: '/config/three' }, // /config/three.md
] { text: 'Four', link: '/config/four' } // /config/four.md
} ]
}
]
} }
} }
} }

Loading…
Cancel
Save