Instructor: Netlify will rebuild our website whenever we push new code, but we want also to trigger the rebuild whenever we do content changes. We can do that using what's called webhooks. Let's go to deploy settings, and in build hooks, you can click add build hook. Let's call this Contentful and hit save.
We grab this URL and go to Contentful. In there, we go into settings, webhooks, and we add webhook. This one, we'll call it Netlify. We will paste our URL in here, and we select specific events that will trigger this rebuild.
We want that whenever we publish a new entry, a content type, or an asset. We can go to publish and check these. Also, in onPublish and onDelete. Let's hit save, and to test our webhook, we can go to the content. Go to this lesson.
Let's change something. Let's remove this question mark, and we hit publish. Now, when we go back to Netlify, and go to deploys, you can see that here, it's triggered by Contentful. Now, it's rebuilding our website.
When we preview this, we should see the new content reflected in the website.