Start Docusaurus
- Node.js version >= 10.15.1
- Yarn version >= 1.5
โฏ node -v
v12.18.4
โฏ yarn version
yarn version v1.22.10
# npx @docusaurus/init@latest init [name] [template]
npx @docusaurus/init@latest init my-website classic
Result:
Success! Created my-website
Inside that directory, you can run several commands:
yarn start
Starts the development server.
yarn build
Bundles the app into static files for production.
yarn deploy
Publish website to GitHub pages.
We suggest that you begin by typing:
cd my-website
yarn start
Happy hacking!
cd my-website/
yarn start
Visit http://localhost:3000/start-docusaurus2/ .
Deploying to GitHub Pages
Modify docusaurus.config.js
:
module.exports = {
title: 'My Site',
tagline: 'The tagline of my site',
url: 'https://ikuokuo.github.io',
baseUrl: '/start-docusaurus2/',
onBrokenLinks: 'throw',
favicon: 'img/favicon.ico',
organizationName: 'ikuokuo',
projectName: 'start-docusaurus2',
...
};
Deploy:
cd my-website/
GIT_USER=ikuokuo USE_SSH=true yarn deploy