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 👍
-
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.
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
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.
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 👍
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.
- Sourcing from GatherContent - a guide on querying with GatherContent.
- GatherContent source plugin
- gathercontent.js - a helper library for getting content from GatherContent