A starter template for Gatbsy and Prismic builds for Public Websites and Supermarket.
- Create a private repo using this as a template when prompted in the willswebsites organisation
- Clone the repo to your local machine
- Install dependencies by running
npm install
inside the project directory - Update project title and description in readme, package.json and gatsby-config.js
- Add an initial commit and push to github
- Start deving with
gatsby develop
- Link Netlify site to github repo for deployment
- Clone the site
git clone ...
- Install dependencies by running
npm install
inside the project directory - Create a .env.development file in the root of the repo to hold the any project variables, like api keys etc. (see https://www.gatsbyjs.com/docs/how-to/local-development/environment-variables/)
- Start deving with
gatsby develop
Master branch set to auto deploy to
To get prismic working with this template:
- Create a new prismic repo and set up a content type (eg. Projects)
- Set up previews in your prismic repo settings (https://prismic.io/docs/previews-gatsby)
- Add your repo name, api key and content type access token to a .env.development file
- Uncomment the prismic plugins in gatsby-config.js
- Uncomment the prismic previews setup in the gatsby-ssr.js and gatsby-browser.js files
- Uncomment the prismic queries and other related bits in the templates/ProjectListPage.js file
- Rename the example projects/ExamplePrismicContentTypeFile.js file to match your content type (eg. {PrismicProject.uid}.js)
- Check your linkResolver, queries and templates are all updated with relevant info to you prismic repo content types.
If you aren't going to use Prismic then you can remove the following:
- Remove the prismic plugins from gatsby-config.js
- Remove the prismic previews setup in the gatsby-ssr.js and gatsby-browser.js files
- Remove the templates/ProjectListPage.js file
- Remove the example projects/ExamplePrismicContentTypeFile.js file
- Remove the linkResolver.js file
- Uninstall the prismic dependencies
npm uninstall gatsby-source-prismic prismic-reactjs gatsby-plugin-prismic-previews