You can view this site at grantavery.com. It uses GatsbyJS (which is built on top of React) to bundle the pages and content (some of which is pulled from my Contentful CMS), and then on push to GitHub, netlify publishes it to update the live site.
npm install -g gatsby-cli
cd grant-avery-com/
npm install
Get the dotenv .env
config file from a fellow developer
The file should include the keys for Contentful's CMS API and Google's Recaptcha.
Example:
GATSBY_SITE_RECAPTCHA_KEY=ENTER_YOUR_KEY_HERE
GATSBY_CONTENTFUL_SPACE_ID=ENTER_YOUR_ID_HERE
GATSBY_CONTENTFUL_DELIVERY_TOKEN=ENTER_YOUR_TOKEN_HERE
GATSBY_PI_API_URL=ENTER_YOUR_URL_HERE
gatsby develop
Available at: http://localhost:8000
!
Note: You'll also see a second link: http://localhost:8000/___graphql
. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the Gatsby tutorial.
gatsby build
gatsby serve
Accessible at {baseUrl}/pi
Uses my Pi API repo as a NodeJS Express API to retrieve Pi values from Google's more cumbersome Pi API.
gatsby new grant-avery-com
-
gatsby-browser.js
: This file is where Gatsby expects to find any usage of the Gatsby browser APIs (if any). These allow customization/extension of default Gatsby settings affecting the browser. -
gatsby-config.js
: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins you’d like to include, etc. (Check out the config docs for more detail). -
gatsby-node.js
: This file is where Gatsby expects to find any usage of the Gatsby Node APIs (if any). These allow customization/extension of default Gatsby settings affecting pieces of the site build process. -
gatsby-ssr.js
: This file is where Gatsby expects to find any usage of the Gatsby server-side rendering APIs (if any). These allow customization of default Gatsby settings affecting server-side rendering.
Looking for more guidance? Full documentation for Gatsby lives on the website. Here are some places to start:
-
For most developers, we recommend starting with our in-depth tutorial for creating a site with Gatsby. It starts with zero assumptions about your level of ability and walks through every step of the process.
-
To dive straight into code samples, head to our documentation. In particular, check out the Guides, API Reference, and Advanced Tutorials sections in the sidebar.