All posts

Astro + Sanity for SEO: how I set up every blog post to rank

Every post on my site gets its title, description, share image, BlogPosting schema, breadcrumbs, sitemap entry and llms.txt line from Sanity automatically, and a script checks every page before it goes live.

Every post on my site gets its SEO from the content itself. Writers fill in a title, SEO title, description and summary in Sanity. Astro then generates the head tags, a structured data graph with the author, a breadcrumb trail, a sitemap entry and a line in llms.txt. Before any deploy, a script checks every built page. Nothing is typed twice and nothing is left to memory.

This is the actual setup behind jeostudio.online, not a template. None of it guarantees rankings. It makes sure the technical side is never the reason a good post doesn't rank.

1. SEO fields in Sanity

Every post, page, project and industry page in my Sanity schema has a reusable `seo` object with three fields:

  • SEO title, with a warning in the editor past 70 characters, because Google usually cuts titles around 60.
  • Description, with a warning past 170 characters.
  • Share image, used for Open Graph and social previews.

If a field is empty, the site falls back to sensible defaults: the post title plus the studio name, and the post's summary. For posts, the share image is a branded title card generated for each article.

2. Answer-first summaries

Each post has an excerpt of up to 240 characters, and every article opens with a bold paragraph that answers the question in the title. This helps readers, and it's the part search engines and AI tools are most likely to quote. I cover the reasoning in Astro for AI search.

3. One structured data graph per page

A small file in the project, `src/lib/seo.ts`, builds a single JSON-LD `@graph` for every page. On a blog post it includes:

  • Organization: the studio, its logo, its social profiles and the countries it serves.
  • Person: me, as the founder, with a stable ID.
  • WebSite.
  • WebPage for the post itself.
  • BlogPosting: headline, description, image, published and modified dates, word count, and the author linked to the same Person ID.
  • BreadcrumbList: Blog, then the post.

Google's Article structured data docs list BlogPosting as a supported type and recommend marking up the author with a name and a URL that identifies them. Linking every post to one Person node keeps that consistent across 80 or more articles.

Other pages get their own types from the same file: FAQPage where there are FAQs, CreativeWork for projects, Service for industry pages and an OfferCatalog on pricing. I deliberately add no ratings, because I have none to show.

Five nodes in the structured data graph: Organization, Person, WebPage, BlogPosting and BreadcrumbList
Generated from Sanity content by one file, src/lib/seo.ts.

4. A real author

Posts reference an Author document in Sanity, not a text field. The page shows a byline with the author's name and role near the top, and an author box at the end. The schema uses the same details. One change to the Author document updates every post.

5. A sitemap built on every build

`src/pages/sitemap.xml.ts` lists every page, project, industry page, migration page and post from Sanity. Each post's `lastmod` is its updated date, or its published date if it hasn't been edited. Admin pages are left out, and robots.txt points crawlers away from them.

Google's sitemap docs recommend submitting the sitemap in Search Console. Google also retired its sitemap ping endpoint in 2023 and said it uses `lastmod` when it's consistently accurate, so I only change a post's date when the post changes.

6. llms.txt

`src/pages/llms.txt.ts` generates a plain-text summary of the site at /llms.txt: who the studio is, the services, the projects and every guide with its summary. The format is a proposal from llmstxt.org, not a standard that search engines have committed to, so I treat it as a cheap extra, not a ranking factor.

7. IndexNow key

The site has an IndexNow key file in place. IndexNow lets a site tell Bing and other participating search engines when URLs change, instead of waiting for a crawl.

8. Related posts and projects

Under every post are two sets of links:

  • "Our work, in practice": related case studies, mapped by hand or chosen by topic.
  • "Keep reading": related posts, mapped by hand or matched by words in their slugs.

Inside the body, I link to other posts and to case studies like Iceberg Quest where they genuinely help. My import script refuses to run if any internal link points to a page that doesn't exist, so there are no broken internal links at publish time.

9. Figures with alt text and captions

Charts and screenshots sit under the heading they support. Every image has alt text that describes what it shows, including the numbers in a chart, and a caption with the source. Charts use only sourced figures or my own Lighthouse results from 8 November 2026.

10. A check on every deploy

`scripts/check-seo.mjs` runs as part of `npm run deploy`. It reads every built HTML page and flags:

  • titles over 70 characters,
  • descriptions over 165 characters or missing,
  • a missing share image,
  • JSON-LD that doesn't parse.

It prints the schema types found on each page, so I can see at a glance that a post has BlogPosting and BreadcrumbList.

Three limits: titles up to 70 characters, descriptions up to 165, zero broken structured data or missing share images
Every built page is checked before upload.

11. Speed by default

Astro pages are static HTML with very little JavaScript, so speed is the default rather than a project. On client rebuilds, Lighthouse's SEO score, which checks technical basics, went from 85 to 100 on Iceberg Quest and from 92 to 100 on True North Charters, measured on 8 November 2026. That's not a ranking measure. See how to read a website speed test for what those scores mean.

Bar chart of SEO scores: Iceberg Quest 85 to 100, True North 92 to 100, Norwegian Fjord Explorer 92 to 100, Veliz-Vice 100 to 100
Lighthouse SEO checks technical basics. It does not predict rankings.

What this setup doesn't do

  • It doesn't write good content. That's still the job.
  • It doesn't build links or reputation.
  • It doesn't guarantee any position in Google.

What it does is remove technical excuses, so the content is judged on its merits.

How to copy this for your site

  1. Add an SEO object to every content type in your CMS, with length warnings.
  2. Generate schema from content in one place, linked by stable IDs.
  3. Generate the sitemap from the CMS, with honest dates.
  4. Make authors documents, not strings.
  5. Validate internal links before publishing.
  6. Check every built page before every deploy.

If you're on Webflow, my Webflow SEO checklist covers the equivalent settings, and Webflow vs Astro for SEO compares the two.

Frequently asked questions

Is Astro good for SEO?

Yes. It outputs fast static HTML and gives you full control of titles, schema and sitemaps.

Do I need an SEO plugin with Astro and Sanity?

No. The SEO fields live in Sanity and the site generates the rest from them.

Does llms.txt help rankings?

There's no evidence it does. It's a proposal that costs little to add.

What schema should a blog post have?

BlogPosting, with headline, dates, image and an author, plus a breadcrumb trail. Google's Article docs list the recommended properties.

Sources

Want this setup on your site? Book a free call and I'll walk you through it.

Work with Jeo Web Studio

Tell us about your business and what you want the site to do. Rough notes are fine. We will reply with honest advice, a plan and a fixed price, or tell you plainly if we are not the right fit.

Book a discovery call

A free 30 minute video call. Talk it through before you commit to anything.

Pick a time

Or tell us about your project

We only use your details to reply. See our privacy policy.