
"One of the reasons I've been digging Astro so much is that it nicely straddles the SSG world and Node.js server worlds. When building your app, you can make logical decisions about what should be done at build time versus what should be done dynamically. It's like having Express and Eleventy rolled into one solution."
"What Live Content Collections provides is a way to have on demand data while still using Astro's 'content collection' metaphor. To test this, I created an app that wrapped the TMDB API to provide the following features: A home page that rendered a list of movie genres. A detail page for each genre showing recently released movies in that genre."
"At a high level, this feature requires: A loader script that handles returning all items in your collection or one particular item. A definition file for your app that defines all the live loaders. Unlike static content collections which are defined in content.config.ts, Astro looks like live collections in live.config.ts."
Astro V6 formally launched with live content collections as a standout feature. This capability allows developers to fetch on-demand data while leveraging Astro's content collection framework. Live content collections require two components: a loader script that retrieves all items or specific items from a collection, and a definition file in live.config.ts that configures live loaders. A practical example demonstrates building a movie application using the TMDB API, featuring a home page listing movie genres and detail pages showing recently released movies per genre. This approach bridges static site generation and dynamic server-side rendering, combining the benefits of both paradigms.
Read at Raymondcamden
Unable to calculate read time
Collection
[
|
...
]