gathercontent-gatsby-demo
v1.0.0
Published
Gatsby starter for creating a simple site with GatherContent
Downloads
5
Readme
gatsby-starter-gathercontent
Getting Started
In this starter you'll use an example project from GatherContent with Gatsby.
If you're interested in how data is sourced from GatherContent you can view the documentation in the GatherContent source plugin 👍
Prerequisites
You have a GatherContent account.
You have a GatherContent API Key.
You have a demo project in GatherContent named "Course records (headless CMS example)".
All accounts should have this demo project. If you can't find this project on your account then our support team can help.
Configuration
To build the site we need to source the data from GatherContent.
Firstly, create a .env.development
file and populate it with the prerequisite data.
# .env.development
GATSBY_GC_EMAIL=<email>
GATSBY_GC_API_KEY=<your_api_key>
GATSBY_GC_PROJECT_ID=<project_id> // you can find this in the project settings
Build & view the demo
npm install
npm run develop
The demo should now be running at http://localhost:8000!
You can start editing the code in src
or update the content in your GatherContent project.
Live edits
You can manually rebuild the project by re-running npm run develop
or you can run npm run refresh
!
By using the refresh command, you won't need to manually restart your development server saving you time 👍
Query guide
The GatherContent source plugin includes a guide on sourcing data from GatherContent.
It is recommended that you read the guide to better understand the schema.
More reading
- Sourcing from GatherContent - a guide on querying with GatherContent.
- GatherContent source plugin
- gathercontent.js - a helper library for getting content from GatherContent