Installation
Docusaurus was designed from the ground up to be easily installed and used to get your website up an running quickly. To install Docusaurus, follow these steps:
+Installation
Docusaurus was designed from the ground up to be easily installed and used to get your website up an running quickly. To install Docusaurus, we have created an easy script that will get all of the infrastructure setup for you:
-
-
Create a
websitefolder in the root of your GitHub repo.
-cd website
-Create a
-package.jsonfile with the following scripts that will be used when developing documentation with Docusaurus:{ - "scripts": { - "start": "docusaurus-start", - "build": "docusaurus-build", - "publish-gh-pages": "docusaurus-publish", - "examples": "docusaurus-examples" - } -} -
-Install Docusaurus with
-yarnornpm-yarn add docusaurus -dev -or
-npm install --save-dev docusaurus -
+- Go into the root of your GitHub repo directory where you will be creating the docs. +
yarn global add docusaurus-initornpm install --global docusaurus-init
+docusaurus-init
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
+│ └── node_modules
+│ └── package.json
+│ └── pages
+│ └── sidebars.json
+│ └── siteConfig.js
+│ └── static
+
++If you do not want to install the init script globally, you can install it locally and then run it from the
+node_modulesdirectory that is created via./node_modules/.bin/docusaurus-init. You may want to remove the createdpackage.jsonfile andnode_modulesdirectory after you run the script.