Skip to main content

Registry

One renderer per component type. It is a client module because it imports the site’s components, which may use hooks or animation libraries.

A renderer

The same anchor helpers, spread as props:
StageMedia is the parity of the Astro <Media> slot: an image key beside a video key, one element chosen from the pair, static markup safe on the zero-JS canvas, in-view playback as progressive enhancement. priority goes on the one above-the-fold slot only. Logos and social-card images stay plain <img>.

A public page

A server component with a per-request cached read:
No export const revalidate. Static at build, regenerated only by the publish handler.

The edit canvas

The one pages-router file. The config line must appear literally; Next extracts it statically and a library cannot export it for you.
getPreviewPageProps runs the gate (the admin’s preview cookie, membership-checked), reads live on every load so a save shows on reload, and renders staged adds from the ?staged= handoff. PreviewDenied is a 404 body that also tells the admin shell to refresh a stale cookie and retry. The article canvas is the same shape at pages/preview/<base>/[slug].tsx with getPreviewArticleProps, wrapped in the site’s shell with globals passed as props.

The browse canvas

The hydrated live site, gated, so the admin can browse normally and only swap to the inert canvas while editing:
resolvePreviewPage is the router-neutral core; getPreviewPageProps wraps it for the pages canvas.

The admin

browseBase is optional. Without it the canvas always loads the inert preview. The edit notch works unchanged; a stateful component on the zero-JS canvas ships a tiny inline script that listens for stage:notch on its wrapper, pages its state, and stamps data-e-current.

Article bodies

Prose runs render inline as sanitised HTML with their anchors, including inline images and videos as static markup. The registry only needs the site’s custom blocks. Layout stays the site’s through className.

Publishing

Set the org’s publish mode to revalidate and its secret. The admin’s Publish button is unchanged; the API posts { secret, paths } to the site’s own handler, which regenerates in seconds.
createRevalidateHandler is the pages-router equivalent with the same options. The secret is compared in constant time; a throwing expandPaths still regenerates what the API asked for and reports the failure rather than answering fully successful. Set REVALIDATE_SECRET in the site’s env to the same value as the org secret.

Env

Exports at a glance