* simplify installation steps Since docusaurus-init is run seldomly, npx keeps it simpler, and subsequent runs will be using the latest version. Outdated provides more meaningful view of current and latest version * add more doc on who can use npx * Make yarn and npm commands more specific
2.4 KiB
id | title |
---|---|
installation | Installation |
Docusaurus was designed from the ground up to be easily installed and used to get your website up and running quickly. To install Docusaurus, we have created an easy script that will get all of the infrastructure setup for you:
-
Ensure you have the latest version of Node installed. We also recommend you install Yarn as well.
While we recommend Node 8.x or greater, your Node version must at least 6.x.
-
Go into the root of your GitHub repo directory where you will be creating the docs.
-
npx docusaurus-init
If you don't have Node 8.2+ or if you prefer to install Docusaurus globally, run
yarn global add docusaurus-init
ornpm install --global docusaurus-init
. After that, rundocusaurus-init
.
After Docusaurus is installed, moving forward, you can check your current version of Docusaurus by going into the
website
directory and typingyarn outdated docusaurus
ornpm outdated docusaurus
. You can update to the latest version of Docusaurus by typingyarn upgrade docusaurus --latest
ornpm update docusaurus
.
Verifying Installation
Along with previously existing files and directories, your root directory will now contain a structure similar to:
root-of-repo
├── docs-examples-from-docusaurus
│ └── doc1.md
│ └── doc2.md
│ └── doc3.md
│ └── exampledoc4.md
│ └── exampledoc5.md
└── website
│ └── blog-examples-from-docusaurus
│ └── 2016-03-11-blog-post.md
│ └── 2017-04-10-blog-post-two.md
│ └── core
│ └── Footer.js
│ └── node_modules
│ └── package.json
│ └── pages
│ └── sidebars.json
│ └── siteConfig.js
│ └── static
Running the Docusaurus initialization script, docusaurus-init
, produces a runnable, example website to base your site upon.
- In your root, rename
docs-examples-from-docusaurus
todocs
. cd website
- Rename
blog-examples-from-docusaurus
toblog
. - Run the local webserver via
yarn start
ornpm start
. - Load the example site at http://localhost:3000. You should see the example site loaded in your web browser.