fix(v2): allow relative sidebar path resolution in docs:version command (#4861)

* fix(v2): allow relative sidebar path resolution in docs:version command

* factorize sidebarPath option resolution logic + dogfood

Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
Alexey Pyltsyn 2021-06-02 19:21:45 +03:00 committed by GitHub
parent 65cf8dacee
commit 35bdde3409
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 6 deletions

View file

@ -235,7 +235,7 @@ const isVersioningDisabled = !!process.env.DISABLE_VERSIONING || isI18nStaging;
docs: {
// routeBasePath: '/',
path: 'docs',
sidebarPath: require.resolve('./sidebars.js'),
sidebarPath: 'sidebars.js',
editUrl: ({locale, docPath}) => {
if (locale !== 'en') {
return `https://crowdin.com/project/docusaurus-v2/${locale}`;