Skip to content

Commit

Permalink
Create deploy-gatsby.md (#1480)
Browse files Browse the repository at this point in the history
* Create deploy-gatsby.md

* Made suggested improvements

* Update deploy-gatsby.md

* Changed React to uppercase.

* Rename deploy-gatsby.md to docs/deploy-gatsby.md

* Rename docs/deploy-gatsby.md to docs/docs/deploy-gatsby.md

* adding deploy gatsby

* Update deploy-gatsby.md

remove additional render
  • Loading branch information
couturecraigj authored and KyleAMathews committed Jul 12, 2017
1 parent 96b6d84 commit c7409fc
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
31 changes: 31 additions & 0 deletions docs/docs/deploy-gatsby.md
@@ -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
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

0 comments on commit c7409fc

Please sign in to comment.