Search code examples
gatsbycontentful

Need to rebuild Gatsby site when I change content on Contentful


I've made a simple website using Gatsby and published it on Netlify. I'm using Contentful as my CMS, but the problem is that whenever I change or add something on Contentful, the change isn't shown on the website until I rebuild it and republish it. (I'm not using continuous deployment)

Is there a way how to automate this process (without continuous deployment)?


Solution

  • What you need is a webhook. Here are the docs: https://www.contentful.com/developers/docs/concepts/webhooks/

    To set up a webhook, go to your Contentful web app, go to settings > webhooks, and on the right of the page, you'll see a button to click to set up a webhook with Netlify.

    You can then choose when to trigger the rebuilds on Netlify how you like so that your new content is rebuilt into your site.