Docusaurus provides a set of scripts to help you generate, serve, and deploy your website. These scripts can be invoked with the run command when using Yarn or npm. Some common commands are: -yarn run start: build and serve the website from a local server -yarn run examples: create example configuration files +yarn run start: build and serve the website from a local server +yarn run examples: create example configuration files Running from the command line The scripts can be run using either Yarn or npm. If you've already gone through our Getting Started guide, you may already be familiar with the start command. It's the command that tells Docusaurus to run the docusaurus-start script which generates the site and starts up a server, and it's usually invoked like so: @@ -29,7 +29,7 @@ npm run start -- --port 8080 Configuration -These scripts are set up under the "scripts" key in your website/package.json file as part of the installation process. If you need help setting them up again, please refer to the Installation guide. +These scripts are set up under the "scripts" key in your website/package.json file as part of the installation process. If you need help setting them up again, please refer to the Installation guide. Docusaurus provides some default mappings to allow you to run commands following Node conventions. Instead of typing docusaurus-start every time, you can type yarn run start or npm start to achieve the same. Commands @@ -46,15 +46,15 @@ docusaurus-build Alias: build. Generates the static website, applying translations if necessary. Useful for building the website prior to deployment. -See also docusaurus-start. +See also docusaurus-start. docusaurus-examples [feature] Alias: examples -When no feature is specified, sets up a minimally configured example website in your project. This command is covered in depth in the Site Preparation guide. Specify a feature translations or versions to generate the extra example files for that feature. +When no feature is specified, sets up a minimally configured example website in your project. This command is covered in depth in the Site Preparation guide. Specify a feature translations or versions to generate the extra example files for that feature. docusaurus-publish Alias: publish-gh-pages -Builds, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in Circle CI, and therefore expects a few environment variables to be defined: +Builds, then deploys the static website to GitHub Pages. This command is meant to be run during the deployment step in Circle CI, and therefore expects a few environment variables to be defined: The following environment variables are generally set manually by the user in the CircleCI config.yml file. GIT_USER: The git user to be associated with the deploy commit. @@ -73,12 +73,12 @@ CIRCLE_PROJECT_USERNAME: The GitHub username or organization name that hosts the Git repo, e.g. "facebook". CIRCLE_PROJECT_REPONAME: The name of the Git repo, e.g. "Docusaurus". -You can learn more about configuring automatic deployments with CircleCI in the Publishing guide. +You can learn more about configuring automatic deployments with CircleCI in the Publishing guide. docusaurus-rename-version <currentVersion> <newVersion> Alias: rename-version Renames an existing version of the docs to a new version name. -See the Versioning guide to learn more. +See the Versioning guide to learn more. docusaurus-start [--port <number>] Alias: start. @@ -87,11 +87,11 @@ docusaurus-version <version> Alias: version Generates a new version of the docs. This will result in a new copy of your site being generated and stored in its own versioned folder. Useful for capturing snapshots of API docs that map to specific versions of your software. Accepts any string as a version number. -See the Versioning guide to learn more. +See the Versioning guide to learn more. docusaurus-write-translations Alias: write-translations -Writes the English for any strings that need to be translated into an website/i18n/en.json file. The script will go through every file in website/pages/en and through the siteConfig.js file and other config files to fetch English strings that will then be translated on Crowdin. See the Translation guide to learn more. +Writes the English for any strings that need to be translated into an website/i18n/en.json file. The script will go through every file in website/pages/en and through the siteConfig.js file and other config files to fetch English strings that will then be translated on Crowdin. See the Translation guide to learn more.