A starter for building websites with Pismic and Gatsby
Click on "Use this repository" button to create your own repository from this template.
- Goto Prismic and create an account and repository if you do not already have one.
- Copy the subdomain name of the repository to the
process.env.PRISMIC_REPO_NAME
environment variable. In this example the url. - Create a custom type, by copy the schemas from src/schemas in to the JSON editor and save.
- Do this for each of the custom-types in the src/schemas directory then return to the repository dashboard and navigate to content and create some content for each of the custom-types.
- Click save -> publish -> publish now.
- Select some content to edit and make a change and click save -> publish -> publish it during a release
- This will walk you though creating a new release.
- Once the release is created go back to the repository dashboard and click on the name of the release name in the top bar navigation.
- The release id can now be found in the url. in this example the release-id is
XtdZ4BIAACMANi0x
. - Add this id to the environment variables in
gatsby-config.js
asprocess.env.PRISMIC_RELEASE_ID
. - Create a preview in Prismic settings -> previews -> create a preview set the name to
local-release
the domain tohttp://localhost:8000
and set the preview path to/previews
. - Add this preview path to
gatsby-config.js
asprocess.env.PRISMIC_PREVIEW_PATH
. - To see the preview build run
GATSBY_CLOUD=true npm start
- Go to gatsby.com and log-in with github and select create a new site.
- Select I have a gatsby site.
- Select the repository that this template has been used in.
- For integrations choose skip this step.
- Set the environment variables in gatsby cloud.
- Click save and create site
Create two webhooks one for gatsby's production build and preview builds in prismic by following the prismic user guide and the urls that can be found for the project on gatsby.com underneath _site settings -> webhooks,