-
Create a Gatsby site.
Use the Gatsby CLI to create a new site, specifying the minimal starter.
# create a new Gatsby site using this starter npx gatsby new my-prismic-starter https://github.com/maheshsamudra/gatsby-prismic-starter
-
Setup Prismic
By default, this starter includes two sample templates:
- Home Page - Single Type
- Page - Repeatable type
Create the custom types in Prismic.io using the schema available in
./initialSchemaSamples
folder.You can delete these files after this step.
-
Update the
.env
Add the
GATSBY_PRISMIC_REPO_NAME
,PRISMIC_ACCESS_TOKEN
,PRISMIC_CUSTOM_TYPES_API_TOKEN
to get started with Prismic.Add the
MAILGUN_DOMAIN
,MAILGUN_API_KEY
,EMAIL_RECIPIENTS
to get started with sending emails for the forms. -
Start developing.
Navigate into your new site’s directory and start it up.
cd my-prismic-starter npm run develop
-
New pages and components
You can create new templates with
plop
. Runnpm run create
to get started with Components and Page templates.Component: creates a new reusable component in ./src/components folder Page Template: creates a new page template in ./src/templates folder
Note: When the page template is created, it will automatically add the related graph queries. However, you'll need to add them manually to
linkResolver
andcomponentResolver
manually. They are located in./config/prismic
folder. -
Open the code and start customizing!
Your site is now running at http://localhost:8000!
Start editing the template pages to see your site update in real-time!
-
Learn more of Gatsby
Deploy this starter with one click on Netlify:
Please see package.json for others