SEO & OG image
Every theme uses a shared Layout.astro that reads SEO defaults from siteConfig.seo and lets each page override them via props.
Defaults — siteConfig.seo
Section titled “Defaults — siteConfig.seo”seo: { title: "Aurora — The modern platform for ambitious teams", description: "Aurora helps teams ship faster, stay organized, and deliver results without the complexity.", ogImage: "/og.png", twitterHandle: "@yourhandle",}| Field | Where it lands |
|---|---|
title | The <title> tag and Open Graph / Twitter card title. |
description | <meta name="description">, OG description, Twitter description. |
ogImage | Path or URL to the share card. Recommended: 1200×630 PNG. |
twitterHandle | Sets twitter:site and twitter:creator if present. |
The canonical URL is built from siteConfig.url plus the current pathname, so set that too:
url: "https://yourdomain.com", // no trailing slashPer-page overrides
Section titled “Per-page overrides”Inside any page, pass props to the layout:
---import Layout from "~/layouts/Layout.astro";---
<Layout title="Pricing — Aurora" description="Three plans, no surprises. Start free, scale when you're ready." ogImage="/og/pricing.png"> {/* …page content… */}</Layout>Only the props you pass override the defaults — everything else falls back to siteConfig.seo.
The Open Graph image
Section titled “The Open Graph image”The image at siteConfig.seo.ogImage is what shows up when someone shares your URL on Slack, Twitter, LinkedIn, iMessage, etc.
Quick path (use the bundled one)
Section titled “Quick path (use the bundled one)”Every theme ships a generic /public/og.png at 1200×630. Replace it with your own keeping the same path and dimensions, and you’re done.
Custom OG image per page
Section titled “Custom OG image per page”Drop a PNG into public/og/ and reference it from the page:
<Layout title="The 2026 State of Astro Themes" ogImage="/og/state-of-astro.png">Generate OG images programmatically
Section titled “Generate OG images programmatically”If you want every blog post to have its own OG card automatically, look at the script in scripts/generate-og.mjs on the marketing repo for reference. Drop a similar script into your theme, wire og to package.json, and call it as part of your build:
"scripts": { "og": "node scripts/generate-og.mjs", "build": "npm run og && astro build"}Robots
Section titled “Robots”Layout.astro sets a sensible default:
<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1">For pages you don’t want indexed (a checkout success page, a private demo), pass noindex to the layout:
<Layout title="Thanks!" noindex>That swaps the meta tag to noindex, nofollow.
Sitemap
Section titled “Sitemap”@astrojs/sitemap is already configured in every theme. After npm run build, you’ll find dist/sitemap-index.xml and dist/sitemap-0.xml. Submit https://yourdomain.com/sitemap-index.xml to Google Search Console.
To exclude a route, edit astro.config.mjs:
sitemap({ filter: (page) => !page.includes('/preview/') && !page.includes('/admin/'),}),What’s next
Section titled “What’s next”- Analytics — wire up Google, Plausible, or Umami.
- Deploy → Custom domain — point your domain at the build so the canonical URL is real.