Skip to content

Building Locally

Larah Armstrong edited this page Oct 12, 2022 · 7 revisions

Note: This content is not actively maintained. If you'd like us to maintain these guides, let us know by opening an issue.

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.

  1. Install NodeJS.
  2. Install Yarn.
  3. Install Docusaurus. At a command prompt, cd to a location on your local. Enter this command to install Docusaurus (it installs and builds a temp project): 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 yarn install (installs packages) and yarn upgrade (updates packages) commands.

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