0

Problem
When Contentful content updates, Netlify rebuilds via webhook but uses outdated _data files instead of fresh Contentful data. The deployed site remains stale.

Current Setup

  • Jekyll site hosted on Netlify, Contentful as headless CMS
  • Netlify build command:
    jekyll contentful && jekyll build
    

Contentful webhook triggers Netlify builds (verified in logs)

✅ Local workflow works:

jekyll contentful → updates _data → push to GitHub → Netlify rebuilds with new content (correct).

❌ Contentful-triggered workflow fails:

Contentful update → Netlify webhook → rebuild runs, but _data stays outdated → deployed site uses old content.

Expected Behavior

Netlify should fetch fresh Contentful data during build (ignoring Git-tracked _data) and deploy with the latest content.

Relevant Configs _config.yml:

contentful:
 spaces:
 - MySpace:
 space: SPACE_TOKEN
 access_token: ACCESS_TOKEN

How can I configure Netlify to always fetch live Contentful data during builds, bypassing the Git-tracked _data folder?

asked May 8 at 22:23
4
  • 1
    Perhaps try clicking the "Clear cache and deploy site" function in the "Deployment" section? Commented May 9 at 18:41
  • I've tried that. It didn't work. The publish directory for jekyll is _site the data lives in _data. Netlify seems to only be looking at the _data contents in the github repository. It seems like the build command jekyll contentful isn't having an effect. In fact, I checked the Netlify build log files and jekyll contentful is almost instantaneous. Commented May 9 at 20:57
  • I don't know contentful that well. but perhaps you should not commit _data to the github repo then? Commented May 10 at 6:49
  • if you do a jekyll contentful --verbose any error message that stands out? Commented May 12 at 9:35

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.