Replies: 1 comment 1 reply
-
|
Afaik no because object keys means categories, and values means list of items. We already transform object to array notation, see https://github.com/facebook/docusaurus/blob/master/packages/docusaurus-plugin-content-docs/src/sidebars.ts#L62 What kind of API are you suggesting? module.exports = {
sidebar: {
`whats-new sidebar label`: `whats-new doc id`,
Introduction: ['introduction/welcome'],
Tutorial: [
'tutorial/01',
],
Guides: [
'guides/data-fetching',
],
},
}I find it a bit confusing, and it would create a new way to create a sidebar doc label (ie we have 3 ways now) Another possibility: module.exports = {
sidebar: [
`whats-new`,
{
Introduction: ['introduction/welcome'],
Tutorial: [
'tutorial/01',
],
Guides: [
'guides/data-fetching',
],
},
},
}This means that by default, any sidebar array object item that does not have a type would be considered as a list of categories object. I'd prefer this option. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We have something like this in
sidebars.js:We'd like to add a top-level "What's new" page, not nested under any category.
I was able to achieve that by using the "array notation", something like this:
Our sidebar is long so this syntax is a bit ugly. Is there a way to add a top-level page using the simpler, object notation?
(I should say that it's not that difficult to write a function that transforms the object to an array notation, but if there's way to avoid that, that would be good.)
Beta Was this translation helpful? Give feedback.
All reactions