mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-18 11:36:53 +02:00
fix(v2): improve dx sidebar config, ability to have no sidebars file (#4775)
* Improve sidebar config * Edit message * fix some little issues in the way undefined/false sidebars are handled * remove old error message as it has been moved to a better place Co-authored-by: Nam Hoang Le <nam.hoang.le@mgm-tp.com> Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
e85ec1ab12
commit
1ab8aa0af8
10 changed files with 235 additions and 129 deletions
|
@ -75,7 +75,7 @@ describe('simple site', () => {
|
|||
),
|
||||
isLast: true,
|
||||
routePriority: -1,
|
||||
sidebarFilePath: path.join(simpleSiteDir, 'sidebars.json'),
|
||||
sidebarFilePath: undefined,
|
||||
versionLabel: 'Next',
|
||||
versionName: 'current',
|
||||
versionPath: '/docs',
|
||||
|
@ -138,6 +138,9 @@ describe('simple site', () => {
|
|||
versionPath: '/myBaseUrl/docs/current-path',
|
||||
versionLabel: 'current-label',
|
||||
routePriority: undefined,
|
||||
sidebarFilePath: undefined,
|
||||
versionEditUrl: undefined,
|
||||
versionEditUrlLocalized: undefined,
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
@ -210,6 +213,7 @@ describe('versioned site, pluginId=default', () => {
|
|||
const defaultOptions: PluginOptions = {
|
||||
id: DEFAULT_PLUGIN_ID,
|
||||
...DEFAULT_OPTIONS,
|
||||
sidebarPath: 'sidebars.json',
|
||||
};
|
||||
const defaultContext = {
|
||||
siteDir: versionedSiteDir,
|
||||
|
@ -607,6 +611,7 @@ describe('versioned site, pluginId=community', () => {
|
|||
id: 'community',
|
||||
path: 'community',
|
||||
routeBasePath: 'communityBasePath',
|
||||
sidebarPath: 'sidebars.json',
|
||||
};
|
||||
const defaultContext = {
|
||||
siteDir: versionedSiteDir,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue