# SEO, RSS & Sitemap

## SEO Metadata

**Required for all pages:**
- `<title>` — unique, descriptive
- `<meta name="description">` — 120–160 chars
- `<link rel="canonical">` — absolute URL

**Required for blog posts (add to `<BaseHead>` / `<Layout>`, not individual pages):**
```html
<meta property="og:title" content="..." />
<meta property="og:description" content="..." />
<meta property="og:type" content="article" />
<meta property="og:url" content="..." />
<meta property="og:image" content="..." />         <!-- hero image, absolute URL -->
<meta property="article:published_time" content="..." />  <!-- ISO 8601 -->
<meta property="article:author" content="..." />
<meta name="twitter:card" content="summary_large_image" />
```

Check `src/components/layout/BaseHead.astro` first — most tags are already handled there.

## RSS Feed

Centralised in `src/lib/rss.ts`. Both feeds call `buildRssFeed(lang, context)` — never duplicate feed logic.

**Required fields when modifying:**
- `atom:link` self-reference with `rel="self"`
- `<language>` tag
- `<lastBuildDate>` and `<copyright>`
- `content:encoded` (CDATA) for item body
- `dc:creator` for author
- `<enclosure>` for hero images
- `<category>` entries from post tags
- All namespaces declared in `xmlns`: `atom`, `dc`, `content`

Only individual blog posts belong in RSS — aggregation/pagination pages never do. The feed filters via `getFilteredPosts({ lang })` which excludes drafts and test posts.

## Sitemap

Generated by `@astrojs/sitemap` with a filter in `astro.config.mjs`.

**Already excluded** (do not remove these rules):
- `/tags/*`
- Blog pagination: `/blog/2/`, `/en/blog/2/`, etc.
- Category pagination: `/categories/tech/2/`, etc.
- `/console/*`, `/preview/*`, `*/embed/`

**What belongs in the sitemap:**
- Individual blog posts ✓
- Tool pages ✓
- Static informational pages ✓
- `/categories/tech/` (first page, no number) — currently included, keep as-is

When adding a new page type with pagination, add a filter rule to `astro.config.mjs` to exclude the `/2/`, `/3/`, ... variants.
