← Back to the journal
DevelopmentAstro

Client-friendly content editing with Sanity and Astro

Sanity Visual Editing lets clients change text and images on a live preview. How click-to-edit works, and when a backend is worth adding.

By Jonah Rivera

The classic tension in client work: static sites are fast and cheap to run, but clients want to edit their own content — and editing should not mean logging into a separate admin and guessing which field controls the headline they are looking at.

Static by default, editable on demand

Astro compiles to static HTML at build time, which is why these sites deploy anywhere and load instantly. The apparent cost is dynamism: no server, no live data. Sanity’s model resolves this by keeping content in the cloud and treating the static site as one rendering target among several.

For most pages, nothing needs to be live. When editors need to preview changes, the site can run with a backend attached — same codebase, different mode.

How visual editing actually works

Sanity Visual Editing overlays presentation tooling on the live site. Three pieces make it feel effortless:

  • Content source maps (stega encoding) tag rendered text with the document fields that produced it, so clicking a heading opens exactly the right editor
  • Draft-mode handling lets the site render unpublished content inside the Studio preview while production visitors only ever see published documents
  • A history adapter keeps Studio navigation and site navigation in sync, so browsing the preview feels like browsing the site

Done well, an editor never learns the phrase “content source map.” They click the thing they want to change and it changes.

What this buys a small team

The payoff is organizational: marketing edits copy without tickets, portfolio pages stay current after every project ships, and nobody pastes unreviewed HTML into a page builder. Structured schemas keep even free-form edits within brand guardrails.

When you do not need it

If content changes quarterly and one person owns publishing, plain static output is simpler — skip the backend entirely. Visual editing earns its keep the moment more than a couple of people touch content, or when freshness directly drives revenue, as it does for studios and travel brands.

Both of our Astro templates ship with this decision already made: Southward runs visual editing end to end out of the box, and Eastward stays static-first with the same path available when needed.