Articles / AI-ready builds

Sanity and Astro: Why We Pair Them for Marketing Sites, and When We Don’t

Sanity holds the content and gives your team an editing app shaped around your site; Astro turns it into fast, static pages; Cloudflare serves them, usually for free. Editors change words, images and pages on their own with visual editing and guardrails, while new templates go through code. Choose Webflow if your team wants to design visually without a developer, and Next.js if the site is really an app.

By ,

Sanity and Astro: Why We Pair Them for Marketing Sites, and When We Don’t

Sanity and Astro are the stack we build most marketing sites on, including our own. Sanity holds the content and gives your team an editing app. Astro turns that content into fast pages. Cloudflare serves them. This guide covers what each part does, what editing looks like day to day, what it costs, and when we'd point you to something else instead.

What each part does

A website on this stack has four parts, and each one has a clear owner.

  • Sanity holds the content. Every page, case study, question and image lives in Sanity as structured content, and your team edits it in Sanity Studio, an editing app shaped around your site.
  • Astro builds the pages. It reads the content and builds plain HTML pages. JavaScript loads only where a part of the page needs it, such as a video player or a form.
  • Cloudflare hosts the site. The finished pages are served from Cloudflare's network, close to every visitor.
  • GitHub keeps the code. The design and the templates live in a repository you own. Changes to the code go through it, and every change can be checked before it goes live.

Editors work in Sanity. Developers, or an AI assistant working with the developer's guardrails, work in the code. Nobody needs to touch hosting after launch.

How they connect

Sanity publishes an official Astro integration, @sanity/astro. It sets up the Sanity client, can host the Studio on a route of your site, and adds click-to-edit overlays for visual editing. Since version 4, released in November 2026, visual editing no longer needs React, so a site built only from Astro components gets it with one component.

Some sites don't need the integration at all. On our own site we use Sanity's client directly: the live site is fully static, and a separate preview build shows drafts with visual editing. Either way the content model and the Studio are the same.

Why we pair them

Fast pages by default

Astro sends the browser finished HTML instead of building the page in JavaScript. Our own site ships about 3 KB of our own JavaScript per page, with no runtime or jQuery. Fast pages help Core Web Vitals, search rankings and conversions, and you don't have to fight the platform to get there.

Content you write once and reuse

Because Sanity stores content as data rather than as pages, one piece of content can appear in many places. A question written once can show on a service page, an article and an FAQ hub. A service's name and description feed its page, the menu, related articles and the structured data search engines read. Change it once and every place updates on the next build.

A Studio built around your team

Sanity Studio is configured in code, so it can be shaped to your content instead of a generic template. In practice that means:

  • Fields named the way your team talks, each with a short note on what goes in it.
  • Only the fields a page actually needs, grouped into tabs.
  • Guardrails that catch mistakes before visitors see them: broken links, missing images, duplicate addresses, text that's too long for search results.
  • Safety for the important pages: single pages like the home page can't be duplicated or deleted, and only admins can delete content.
  • A redirect made automatically when someone changes a page's address, so old links and rankings keep working.

We call this a custom Sanity Studio, and it's most of what makes a site easy to run after launch.

Setting up a Studio like this is also a service on its own, for new sites, existing sites built in code and moves from another CMS: see Sanity CMS development.

Ready for search and AI answers

Structured content is easy to turn into the things search engines and AI tools read: structured data on every page, a sitemap, an llms.txt file and answers with their own link. On this stack all of that is generated from the content your team already edits, so it never goes stale.

No lock-in

The code is in your GitHub, the content in your Sanity project and the hosting in your Cloudflare account. If you change agency, the next team picks it up where we left off.

Cloudflare bought the company behind Astro in January 2026. Astro stays open source under the MIT licence and still runs on other hosts, so the deal changes nothing about who owns your site.

What day-to-day editing looks like

What your team does on its own

  • Edit words, images and videos on any page.
  • Add articles, case studies, team members, questions and other content the site is built for.
  • Change page addresses, search titles and share images.
  • Preview a draft exactly as it will look before publishing.
  • See whether the site has problems, such as broken links, and whether the latest changes are live.

Publishing and rebuilds

When someone publishes in the Studio, Sanity tells the host to rebuild the site. On our setup the change is live in about a minute. The Studio shows whether published changes are live yet, and the site's link check runs on every build.

Previews and visual editing

Visual editing shows the site next to the Studio. Click any heading or image and the matching field opens. Drafts show in the preview straight away, so a change can be checked, or approved by someone else, before it goes live. Sanity's Free plan includes this.

What still needs a developer

  • A new kind of section or page template.
  • Layout and design changes.
  • New integrations, such as a CRM or a booking system.

This is where the stack has changed most. Every site we hand over comes with AI handover documents: the content model, the design rules and the parts that must not break, written for an AI assistant. With those, a tool like Claude can make structural changes safely, and the build checks catch mistakes before they go live. There's more on this in our guide to CLAUDE.md files for website projects.

What it costs

Software. Sanity's Free plan covers most small and mid-size marketing sites: 20 seats, two roles, 10,000 documents and visual editing, with hard limits instead of surprise bills. The Growth plan, at $15 per seat a month, adds comments, tasks, scheduled drafts and more roles. Coordinated Content Releases need the Enterprise plan.

Hosting. Static pages on Cloudflare are free, with unlimited requests. A paid Workers plan from $5 a month covers extras like a contact form that sends email. Our Cloudflare hosting guide has the details.

The build. Our Astro and Sanity builds start from €10,000, and migrations from another platform start at the same. After launch your team runs the site, or we look after it on a monthly care plan.

For a wider comparison of CMS prices, see Sanity vs Contentful, Storyblok and Payload.

When to choose something else

When Webflow is the better fit

If your team is design-led, wants to rearrange whole pages visually and has no developer, Webflow is often the better choice. Its designer, CMS and hosting live in one product, and the Webflow MCP now lets an AI assistant manage content and pages after launch. We build in both; Webflow vs Astro compares them honestly.

When Next.js is the better fit

If the site is really an app, with logins, dashboards or data that changes for each visitor, Next.js is built for that. See Astro vs Next.js for marketing sites.

When you don't need a CMS

If only developers will ever change the site, Sanity may be more than you need. Astro can read content from Markdown files in the code repository. A simple test: if nobody outside the code will edit the site, start without a CMS. You can add one later.

How we build a Sanity and Astro site

  1. Audit. We list every page and address, and what your team edits most.
  2. Content model. We shape the content in Sanity around your site, not a template.
  3. Studio. We set up the editing app with field notes, guardrails and visual editing.
  4. Build. We build the pages in Astro from your design or ours.
  5. Move. If you're moving from another platform, content is imported with scripts and every old address is kept or redirected. Our Webflow to Astro guide shows how we did it for our own site.
  6. Hand over. Studio training, AI handover documents and four weeks of aftercare.

If you'd like a site like this, our Astro and Sanity development service is where to start.

Rather have us do it?

Send a few lines about it. Mark replies within 48 hours to set up a free call and a fixed quote.

Book a free call