# Astro 2026 SEO Best Practices (Token-Efficient Reference)

## ⚡ Core Engine (Astro Advantages)
* **SSG by default**: Ship static HTML -> fast crawlers index.
* **Islands (zero JS)**: Hydrate only active UI -> low LCP / INP.
* **Optimized Images**: Use `<Image />` component -> webp/avif, auto sizing, lazy loading.

## 📝 SEO Metadata
* **Head tags**: Unique `<title>` (50-60 chars) & `<meta name="description">` (150-160 chars) per route.
* **Canonical URL**: Absolute URL in `<link rel="canonical" href="...">` -> prevent duplication.
* **Open Graph (OG)**: `og:title`, `og:description`, `og:image`, `og:type` -> social previews.

## 🔍 Crawl & Index
* **Sitemap**: `@astrojs/sitemap` integration -> auto-generates `/sitemap-index.xml`.
* **Robots**: `public/robots.txt` -> guide search crawlers.
* **URL hygiene**: Clean Kebab-case slugs, no trailing dates/exts.

## 🕸️ Schema Markup (JSON-LD)
* **Articles**: Inject article schema inside blog post layout for google rich snippets:
  ```html
  <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "BlogPosting",
      "headline": "Title",
      "datePublished": "ISO",
      "author": { "@type": "Person", "name": "Author" }
    }
  </script>
  ```

## 🤖 AI Search visibility
* **llms.txt**: Create `public/llms.txt` and `llms-full.txt` -> AI crawler context & summary.

## 📊 Analytics
* **No blocking script**: Load analytics scripts via `is:inline` + `async` to avoid blocking main thread.
