Skip to content

Commit c9b333d

Browse files
committed
update readme for local gatsby
1 parent 1c79f51 commit c9b333d

File tree

1 file changed

+31
-24
lines changed

1 file changed

+31
-24
lines changed

README.md

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Pantheon Documentation
88

99
https://pantheon.io/docs/
1010

11-
This repository contains the [Pantheon](https://pantheon.io) documentation, as well as the tools to build local test environments.
11+
This repository contains the [Pantheon](https://pantheon.io) documentation as well as the tools to build local test environments.
1212

1313
## Changelog
1414

@@ -25,6 +25,7 @@ Read [our Style Guide](https://pantheon.io/docs/style-guide) for our guidelines
2525
### Prerequisites
2626
- MacOS or Linux system (untested with Bash on Windows)
2727
- [Node.js](https://nodejs.org/en/)
28+
- [NVM](https://github.com/nvm-sh/nvm#installing-and-updating)
2829
- Gatsby CLI:
2930

3031
```bash
@@ -33,53 +34,61 @@ Read [our Style Guide](https://pantheon.io/docs/style-guide) for our guidelines
3334

3435
- Alternatively, you can use [Lando](https://docs.lando.dev). Use Lando to bypass installing Node.js and the Gatsby CLI on your local machine. Lando requires a Docker version in the `2.1.0.0` - `3.1.99` range.
3536

36-
### Get the Code
37+
#### Mac Steps
3738

38-
Fork and clone this repository.
39+
This list of steps should work on a Mac with [Homebrew](https://brew.sh/):
3940

4041
```bash
41-
git clone https://github.com/pantheon-systems/documentation.git
42+
brew install node
43+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
44+
nvm install 14
45+
npm install -g gatsby-cli
4246
```
4347

44-
Or
48+
### Get the Code
49+
50+
Fork and clone this repository:
4551

4652
```bash
4753
git clone git@github.com:pantheon-systems/documentation.git
4854
cd documentation
4955
```
5056

51-
### Install
52-
53-
#### Using the Gatsby CLI directly
54-
55-
```bash
56-
npm ci
57-
```
57+
### Create a GitHub API Token
5858

59-
#### GitHub Token
60-
You can install directly on your host computer or via Lando. Both ways require the docs app to use a `GITHUB_API` token to operate.
6159
We use the [gatsby-remark-embed-snippet](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-embed-snippet) to use files from GitHub in our docs. Before you can build a local development site, you need to provide a GitHub token to the environment:
6260

6361
1. Log in to GitHub and go to <https://github.com/settings/tokens>
64-
1. Click Generate new token
65-
1. Give the token a name and click the **public_repo** checkbox, then the Generate Token button at the bottom
66-
1. Copy the token to your clipboard.
67-
1. Create or edit `.env.development`, and add (replacing `$TOKENHASH` ):
62+
1. Click **Generate new token**
63+
1. Give the token a name and click the **public_repo** checkbox, then the **Generate Token** button at the bottom
64+
1. Copy the token to your clipboard
65+
1. In the root `documentation` directory, create a new file called `.env.development` and add (replacing `$TOKENHASH` ):
6866

6967
```bash
7068
GITHUB_API=$TOKENHASH
7169
```
7270

71+
## Install With The Gatsby Cli
72+
73+
From the `documentation` directory:
74+
75+
```bash
76+
npm ci
77+
```
78+
7379
### Run
7480

81+
Still in the `documentation` directory:
82+
7583
```bash
76-
cd documentation/
77-
gatsby develop
84+
npm run develop
7885
```
79-
You can view the local environment at `localhost:8000/`. Updates to docs are automatically refreshed in the browser.
8086

87+
Use your local browser to navigate to `localhost:8000/`.
88+
89+
Locally saved updates to docs are automatically refreshed in the browser.
8190

82-
#### Using Lando
91+
## Install With Lando
8392

8493
Alternatively, you can use [Lando](https://gist.github.com/tormi/a8b8fc39f9481373b24dc94cb8d2ee31). The `lando start` command initiates the app, installs node dependencies, and starts the `gatsby develop` server for you:
8594

@@ -89,12 +98,10 @@ lando start
8998

9099
You can view the local environment at `localhost:8000/`. Updates to docs are automatically refreshed in the browser.
91100

92-
93101
## Testing
94102

95103
We include several tools to test that new content doesn't break the documentation. Most of these tests are performed automatically by our continuous integration service, but pull requests created from external contributors aren't included in CI tests. If you want to manually test your branch, you can execute the following tests within the Docker container.
96104

97105
### Merge Conflicts
98106

99107
To check for merge conflict messages accidentally committed into the docs, run `merge_conflicts.sh` from `scripts`.
100-

0 commit comments

Comments
 (0)