mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-09 14:22:27 +02:00
fix(v2): fix migrate cli paths (sidebars/customcss) (#3358)
* fix: Allow docusaurus-migrate to create relative paths #3239 * fix migration cli sidebars/customcss paths * fix migration cli sidebars paths Co-authored-by: PalAditya <adityapal.nghss@gmail.com>
This commit is contained in:
parent
a999928ad8
commit
4bfc3bbbe7
1 changed files with 5 additions and 2 deletions
|
@ -639,7 +639,10 @@ function migrateLatestSidebar(
|
||||||
path.join(siteDir, 'sidebars.json'),
|
path.join(siteDir, 'sidebars.json'),
|
||||||
path.join(newDir, 'sidebars.json'),
|
path.join(newDir, 'sidebars.json'),
|
||||||
);
|
);
|
||||||
classicPreset.docs.sidebarPath = path.join(newDir, 'sidebars.json');
|
classicPreset.docs.sidebarPath = path.join(
|
||||||
|
path.relative(newDir, siteDir),
|
||||||
|
'sidebars.json',
|
||||||
|
);
|
||||||
} catch {
|
} catch {
|
||||||
console.log(
|
console.log(
|
||||||
chalk.yellow(`Sidebar not found. Skipping migration for sidebar`),
|
chalk.yellow(`Sidebar not found. Skipping migration for sidebar`),
|
||||||
|
@ -660,7 +663,7 @@ function migrateLatestSidebar(
|
||||||
fs.mkdirpSync(path.join(newDir, 'src', 'css'));
|
fs.mkdirpSync(path.join(newDir, 'src', 'css'));
|
||||||
fs.writeFileSync(path.join(newDir, 'src', 'css', 'customTheme.css'), css);
|
fs.writeFileSync(path.join(newDir, 'src', 'css', 'customTheme.css'), css);
|
||||||
classicPreset.theme.customCss = path.join(
|
classicPreset.theme.customCss = path.join(
|
||||||
newDir,
|
path.relative(newDir, path.join(siteDir, '..')),
|
||||||
'src',
|
'src',
|
||||||
'css',
|
'css',
|
||||||
'customTheme.css',
|
'customTheme.css',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue