Merge pull request #29085 from hashicorp/add-local-preview-instr-readme

Add instructions to preview docs site locally to /website readme
This commit is contained in:
Laura Pacilio 2021-07-02 14:06:33 -04:00 committed by GitHub
commit 341b1d7628
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,3 +7,24 @@ The files in this directory are intended to be used in conjunction with
[the `terraform-website` repository](https://github.com/hashicorp/terraform-website), which brings all of the [the `terraform-website` repository](https://github.com/hashicorp/terraform-website), which brings all of the
different documentation sources together and contains the scripts for testing and building the site as different documentation sources together and contains the scripts for testing and building the site as
a whole. a whole.
## Previewing Changes
You should preview all of your changes locally before creating a pull request. The build includes content from this repository and the [`terraform-website`](https://github.com/hashicorp/terraform-website/) repository, allowing you to preview the entire Terraform documentation site. If `terraform-website` isn't in your `GOPATH`, the preview command will clone it to your machine.
**Set Up Local Environment**
1. [Install Docker](https://docs.docker.com/get-docker/).
2. Create a `~/go` directory manually or by [installing Go](https://golang.org/doc/install).
3. Open terminal and set `GOPATH` as an environment variable:
Bash: `export $GOPATH=~/go`(bash)
Zsh: `echo -n 'export GOPATH=~/go' >> ~/.zshrc`
4. Restart your terminal or command line session.
**Launch Site Locally**
1. Navigate into your local `terraform` top-level directory and run `make website`.
2. Open `http://localhost:4567` in your web browser. While the preview is running, you can edit pages and Middleman will automatically rebuild them.
3. When you're done with the preview, press `ctrl-C` in your terminal to stop the server.