Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create deploy-gatsby.md #1480

Merged
merged 9 commits into from
Jul 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions docs/docs/deploy-gatsby.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Deploying Gatsby

## Best Practice


Though you can deploy from the same location multiple times it is recommended that you clear your public directory of any `.html` files before each build
e.g. using surge

```bash
rm -rf public/*.html && gatsby build && surge public/
```

because this is going to be executed on every deploy it is suggested that you use a `package.json` script to simplify this process

## Providers

[Surge.sh](http://surge.sh/)

[Forge](https://getforge.com/)

[Netlify](https://www.netlify.com/)

[GitHub-Pages](https://pages.github.com/)

## Debugging

`Unable to find element with ID ##`
or alternatively
`Uncaught Error: Minified React error #32; visit http://facebook.github.io/react/docs/error-decoder.html?invariant=32&args[]=## for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`

This is a new problem when dealing with static sites built with React. React uses HTML comments to help identify locations of components that do not render anything. If you are using a CDN that minifies your HTML, it will eliminate the HTML comments used by react to take control of the page on the client.
1 change: 1 addition & 0 deletions www/src/pages/docs/doc-links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Building with Components: /docs/building-with-components/
Querying with GraphQL*: /docs/querying-with-graphql/
Gatsby Lifecycle APIs: /docs/gatsby-lifecycle-apis/
Deploying: /docs/deploy-gatsby/
Plugins: /docs/plugins/
PRPL Pattern: /docs/prpl-pattern/
Gatsby on Windows: /docs/gatsby-on-windows/
Expand Down