gatsby-contentful-starter | Gatsby starter for a Contentful project | Frontend Framework library
kandi X-RAY | gatsby-contentful-starter Summary
kandi X-RAY | gatsby-contentful-starter Summary
Gatsby starter for a Contentful project from the community.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of gatsby-contentful-starter
gatsby-contentful-starter Key Features
gatsby-contentful-starter Examples and Code Snippets
Community Discussions
Trending Discussions on gatsby-contentful-starter
QUESTION
I am playing around with the gatsby contentful starter. I have everything set up so that I can make content changes in contentful and the webhook posts those to a remote Netlify site, and all I have to do is refresh the netlify site to see latest CMS changes. Locally, however, in order to see the CMS changes, I have to ctrl-c
from yarn develop
, and restart the packager. Is there a way to keep that in sync as well, so that all I have to do is refresh the page? (or even better, HMR).
ANSWER
Answered 2020-Apr-21 at 20:10You are looking for environment variables. Gatsby has a bunch of them reserved to do what you need (and more).
Gatsby exposes a /__refresh
webhook that is able to receive POST requests to refresh the sourced content. This exposed webhook can be triggered whenever remote data changes, which means you can update your data without re-launching the development server.
First of all, you need to allow Gatsby to use environment variables by adding this snippet in your gatsby-config.js
(above module exportation):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gatsby-contentful-starter
This project comes with a Contentful setup command yarn run setup. This command will ask you for a space ID, and access tokens for the Contentful Management and Delivery API and then import the needed content model into the space you define and write a config file (./contentful.json). yarn run setup automates that for you but if you want to do it yourself rename .contentful.json.sample to .contentful.json and add your configuration in this file.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page