Frontend
Putting a Next.js site in front of the API: reading content, rendering Portable Text and images, caching, and previewing drafts.
Putting a Next.js site in front of it
Mount the API, mount the Studio, read content in a server component. The reference frontend in this repository is the worked example.
Rendering Portable Text and images
Server-render with @portabletext/react, pass your own schema types in as components, and classify every href before you emit an anchor.
Caching and revalidation
Every read carries the sync tags it depends on. Use them as cache tags and a publish purges exactly the pages that read the document.
Previewing drafts
A preview route enables draft mode and switches reads to the drafts perspective, so an editor sees unpublished work on the real site.
