docs: add "previewing docs" section to the contributing.md
This commit is contained in:
@@ -89,3 +89,14 @@ If you are committing to [templates](./templates) or [examples](./examples), use
|
|||||||
## Pull Requests
|
## Pull Requests
|
||||||
|
|
||||||
For all Pull Requests, you should be extremely descriptive about both your problem and proposed solution. If there are any affected open or closed issues, please leave the issue number in your PR message.
|
For all Pull Requests, you should be extremely descriptive about both your problem and proposed solution. If there are any affected open or closed issues, please leave the issue number in your PR message.
|
||||||
|
|
||||||
|
## Previewing docs
|
||||||
|
|
||||||
|
This is how you can preview changes you made locally to the docs:
|
||||||
|
|
||||||
|
1. Clone our [website repository](https://github.com/payloadcms/website)
|
||||||
|
2. Run `yarn install`
|
||||||
|
3. Duplicate the `.env.example` file and rename it to `.env`
|
||||||
|
4. Add a `DOCS_DIR` environment variable to the `.env` file which points to the absolute path of your modified docs folder. For example `DOCS_DIR=/Users/yourname/Documents/GitHub/payload/docs`
|
||||||
|
5. Run `yarn run fetchDocs:local`. If this was successful, you should see no error messages and the following output: *Docs successfully written to /.../website/src/app/docs.json*. There could be error messages if you have incorrect markdown in your local docs folder. In this case, it will tell you how you can fix it
|
||||||
|
6. You're done! Now you can start the website locally using `yarn run dev` and preview the docs under [http://localhost:3000/docs/](http://localhost:3000/docs/)
|
||||||
|
|||||||
Reference in New Issue
Block a user