Skip to content

Building Locally

Lori Krell edited this page Mar 23, 2021 · 7 revisions

We use Docusaurus v2 for our documentation site. All tools you need are part of the repository.

Docusaurus on Mac

You need to install the following only once to write and build locally. We recommend Homebrew for easier commands.

  1. Install NodeJS: https://nodejs.org/en/download/
  2. Install Yarn: brew install yarn
  3. Install Docusaurus. In terminal, cd to a location on your local. Enter this command to install Docusaurus (it installs and builds a temp project): npx @docusaurus/init@latest init temp classic.
  4. Let it run. When done, you should see a directory called temp with a project in it. Delete the directory, you do not need it.

Docusaurus on PC/Windows

You need to install the following only once to write and build locally. We recommend Chocolatey for easier commands.

  1. Install NodeJS: choco install nodejs.install
  2. Install Yarn: choco install yarn
  3. Install Docusaurus: yarn global add docusaurus-init

Build Locally

  1. Update your local cloned GitHub repository.
  2. In a command line, change to the directory of the cloned repo.
  3. Build the site: yarn build.
  4. Serve and run the site, hot reloading as you make changes in the code: yarn start.
  5. When done, it automatically opens a webpage at http://localhost:3000.

The build process includes a few tests for internal markdown links, source files, and images.

If you need to install or update packages, use the yarn install (installs packages) and yarn upgrade (updates packages) commands.

If you have issues, contact Unity writers in the Discord documentation channel.

Clone this wiki locally