Skip to content

My personal website, built with React, GatsbyJS, and netlify

License

Notifications You must be signed in to change notification settings

grantavery/grant-avery-com

Repository files navigation

GrantAvery.com

Netlify Status

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.

Local Dev

Gatsby setup

npm install -g gatsby-cli

Change directories into site folder

cd grant-avery-com/

Install dependencies

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

Start development server

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.

Create a production build

gatsby build

Serve the production build locally

gatsby serve

Pi Page

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 Info (taken from their starter project README)

Create a new site

gatsby new grant-avery-com

Different files

  • 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.

Learning Gatsby

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.

About

My personal website, built with React, GatsbyJS, and netlify

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published