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,7 +92,8 @@ 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', text: 'Guide',
items: [ items: [
// This shows `/guide/index.md` page. // This shows `/guide/index.md` page.
@ -100,19 +101,22 @@ export default {
{ text: 'One', link: '/guide/one' }, // /guide/one.md { text: 'One', link: '/guide/one' }, // /guide/one.md
{ text: 'Two', link: '/guide/two' } // /guide/two.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', text: 'Config',
items: [ items: [
// This shows `/guide/index.md` page. // This shows `/guide/index.md` page.
{ text: 'Index', link: '/config/' }, // /config/index.mdasdfasdfasdfasdfaf { text: 'Index', link: '/config/' }, // /config/index.md
{ text: 'Three', link: '/config/three' }, // /config/three.md { text: 'Three', link: '/config/three' }, // /config/three.md
{ text: 'Four', link: '/config/four' } // /config/four.md { text: 'Four', link: '/config/four' } // /config/four.md
] ]
} }
]
} }
} }
} }

Loading…
Cancel
Save