├── gatsby-config.js ├── src ├── pages │ ├── 404.js │ ├── thanks.js │ ├── index.js │ ├── contact.js │ ├── file-upload.js │ └── recaptcha.js ├── html.js ├── layouts │ └── index.js └── css │ └── typography.css ├── .gitignore ├── package.json ├── .travis.yml ├── LICENSE └── README.md /gatsby-config.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = { 3 | siteMetadata: { 4 | title: `Gatsby Netlify Form Integration` 5 | }, 6 | plugins: [`gatsby-plugin-react-helmet`] 7 | }; 8 | -------------------------------------------------------------------------------- /src/pages/404.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | 3 | export default () => 4 |
5 |

NOT FOUND

6 |

You just hit a route that doesn't exist... the sadness.

7 |
8 | -------------------------------------------------------------------------------- /src/pages/thanks.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default () => ( 4 |
5 |

Thank you!

6 |

This is a custom thank you page for form submissions

7 |
8 | ); 9 | -------------------------------------------------------------------------------- /src/pages/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Link from "gatsby-link"; 3 | import Helmet from "react-helmet"; 4 | 5 | export default class Index extends React.Component { 6 | render() { 7 | return ( 8 |
9 |

Hi people

10 |

11 | This is an example site integrating Netlify’s form handling with Gatsby 12 |

13 | 18 |
19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 27 | node_modules 28 | .gatsby-context.js 29 | .sass-cache/ 30 | public/ 31 | .cache/ 32 | .DS_Store 33 | 34 | # Environment variables 35 | .env.development 36 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gatsby-starter-default", 3 | "description": "Gatsby default starter", 4 | "version": "1.0.0", 5 | "author": "Kyle Mathews ", 6 | "dependencies": { 7 | "gatsby": "^1.9.261", 8 | "gatsby-link": "^1.0.1", 9 | "gatsby-plugin-react-helmet": "^1.0.1", 10 | "react-async-script": "^0.9.1", 11 | "react-google-recaptcha": "^0.11.1" 12 | }, 13 | "devDependencies": { 14 | "dotenv": "^5.0.1", 15 | "gh-pages": "^0.12.0" 16 | }, 17 | "keywords": [ 18 | "gatsby" 19 | ], 20 | "license": "MIT", 21 | "main": "n/a", 22 | "scripts": { 23 | "build": "gatsby build", 24 | "deploy": "gatsby build --prefix-paths && gh-pages -d public", 25 | "develop": "gatsby develop", 26 | "format": "prettier --trailing-comma es5 --no-semi --single-quote --write \"pages/*.js\" \"utils/*.js\" \"wrappers/*.js\" \"html.js\"", 27 | "test": "echo \"Error: no test specified\" && exit 1" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # back to language cpp to try to bypass osx node failure 2 | language: cpp 3 | sudo: false 4 | env: 5 | - export NODE_VERSION="0.12" 6 | - export NODE_VERSION="4" 7 | - export NODE_VERSION="5" 8 | os: 9 | - linux 10 | - osx 11 | # pre-install to bring in the correct version of node via nvm 12 | before_install: 13 | - git submodule update --init --recursive 14 | - git clone https://github.com/creationix/nvm.git ./.nvm 15 | - source ./.nvm/nvm.sh 16 | - nvm install $NODE_VERSION 17 | - nvm use $NODE_VERSION 18 | - npm config set python `which python` 19 | - if [ $TRAVIS_OS_NAME == "linux" ]; then 20 | export CC="gcc-4.8"; 21 | export CXX="g++-4.8"; 22 | export LINK="gcc-4.8"; 23 | export LINKXX="g++-4.8"; 24 | fi 25 | - gcc --version 26 | - g++ --version 27 | # node 4 depends on gcc 4.8 28 | addons: 29 | apt: 30 | sources: 31 | - ubuntu-toolchain-r-test 32 | packages: 33 | - g++-4.8 34 | - gcc-4.8 35 | # script needed to test, because defaults don't work on osx 36 | script: 37 | - npm install 38 | - npm run lint 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 gatsbyjs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /src/html.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import PropTypes from "prop-types" 3 | 4 | const BUILD_TIME = new Date().getTime() 5 | 6 | export default class HTML extends React.Component { 7 | static propTypes = { 8 | body: PropTypes.string, 9 | } 10 | 11 | render() { 12 | let css 13 | if (process.env.NODE_ENV === "production") { 14 | css = ( 15 |