This site supports JAMstack Cincinnati's June 2019 meetup on Getting Started with Static Site Generators. This meetup represents the second in a multi-step series on getting comfortable working with the JAMstack.
Before we dig in, make sure you have the prerequisites covered:
- A basic understanding of Git.
- A GitHub account.
- Basic knowledge of HTML and CSS.
- Yarn is not 100% necessary, but can make working with the project in development (on your machine) a little easier.
In this workshop, we'll be building a static site using GatsbyJS. First, install the Gatsby-CLI with npm
or yarn
:
$ npm install -g gatsby-cli
$ yarn global add gatsby-cli
Set up a new Gatsby project using this repo as a starter kit:
$ gatsby new ssg-workshop https://github.com/jamstack-cincinnati/1906-getting-started-with-static-sites
Switch to the project directory:
$ cd ssg-workshop
Gatsby-CLI includes commands to run a web server. Make sure the JS packages are installed first (yarn install
) and then start the development server:
$ gatsby develop
After doing this, you should be able to navigate to http://localhost:8000
in your browser and see the home page of the project.
You can also build and run a production version of your site using:
$ gatsby build
$ gatsby serve
If you run into build errors, you can trying reseting the project cache using:
$ gatsby clean
Check the Wiki tab for some helpful Static Site Generator links.
master
- Workshop starter kitssg-workshop-complete
- Completed workshop project
These are the steps we're going to follow in the workshop:
- Project Structure & Routing
- Pre-fetching with Gatsby Link
- Gatsby Image
- Components
- Props
- State
- Plugins
- Styled Components
- Web Font Loader
- Build settings
- July Meetup: Getting Started With Headless CMS