Rethinking how @silex generates a @11ty website

Today, a user designs a page with data from a CMS → publish ⇒ page1.11tydata.js + page1.liquid (one data file + one template per page)

Problem: Eleventy can’t detect CMS changes → no `eleventy --serve` nor incremental build

It also feels off, not JAMstacky right?

#11ty #JAMstack #GraphQL #WebDev #foss #opensource

@silex @11ty

What about: user designs a page → publish ⇒ _graphql/data-source1.graphql + page1.liquid

Then before eleventy we run the queries → _data/generated/data-source1.json (think wordpress.json and supabase.json )

This would be closer to Eleventy/JAMstack patterns right?

Also cacheable, works with local dev (eleventy --serve) and somewhat incremental friendly (probably not as wordpress is too broad)

Ideally I woul love it to be just markdown files generated from the CMS

@lexoyo have you tried adding watch targets to the config?

https://www.11ty.dev/docs/watch-serve/#add-your-own-watch-targets

Watch and Serve

A docs page for Eleventy, a simpler static site generator.

Eleventy

@bobmonsour i think the issue is that changes happen in the CMS/database, not as local files Eleventy can watch

That’s why I’m thinking about adding a pre-build step to fetch the data as json files in _data. Probably a big json file is not a good idea

@lexoyo I have a 2.3MB json file that Eleventy ingests whenever I build the 11ty Bundle site. I don't have it watch it, but I imagine I could during local build/serve sessions.

@bobmonsour ouah 11ty 💪

But tbh my concern isn’t really the JSON size, but the fact that with a single data file (as with my current setup / data files) any change in the CMS invalidates everything and triggers a full rebuild

It's no big deal for a dev in local but I struggle with preview for content editors. I’m not sure how people usually handle this with Eleventy