mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-25 06:56:56 +02:00
feat: enable custom theme with eject
This commit is contained in:
parent
8c6bc6dd38
commit
2b5ee3e869
6 changed files with 40 additions and 7 deletions
16
lib/commands/eject.js
Normal file
16
lib/commands/eject.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
const fs = require('fs-extra');
|
||||
const chalk = require('chalk');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = async function eject(siteDir) {
|
||||
const defaultTheme = path.resolve(__dirname, '..', 'theme');
|
||||
const customTheme = path.resolve(siteDir, 'theme');
|
||||
await fs.copy(defaultTheme, customTheme);
|
||||
|
||||
const relativeDir = path.relative(process.cwd(), customTheme);
|
||||
console.log(
|
||||
`\n${chalk.green('Success!')} Copied default theme files to ${chalk.cyan(
|
||||
relativeDir
|
||||
)}.\n`
|
||||
);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue