SEO/GEO/GSC: sitemap index + caching, Search & AI settings, getRobots

- Sitemap: batched reads (500), published-only where, field select; sitemap
  index over maxUrls (default 10k) with ?part=N; Cache-Control; in-process
  memo; runtime errors → 503 Retry-After (empty urlset only during next build)
- Site Settings → Search & AI tab (seo.searchSettings: false removes it):
  Google/Bing/Yandex verification (paste code or whole meta tag) added to
  page metadata; AI crawler policy + per-bot exceptions; llms.txt note
- buildRobots aiBotRules; getRobots helper reads the panel; more AI agents
- Under construction: sitemap and llms.txt list only open pages
- collectSiteIndex: no silent 1000 cap; llms routes send Cache-Control
- IndexNow: nothing sent with IPAL_NOINDEX
- Unknown route metadata is noindex
- Tests (unit + SQLite integration) and docs/seo.md

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-22 17:09:01 +02:00
co-authored by Claude Opus 5.5
parent 12fbd424a5
commit 94e563055f
23 changed files with 1144 additions and 67 deletions
+7
View File
@@ -1,5 +1,6 @@
import type { I18nConfig, LocalizedSlugs } from '../i18n/index.js'
import type { TitleOrder } from './composeTitle.js'
import type { VerificationMetadata } from './searchSettings.js'
import type { SeoMeta } from './types.js'
import { buildLocalizedPath } from '../i18n/index.js'
@@ -59,6 +60,8 @@ export type PageMetadata = {
images?: string[]
title: string
}
/** Search console ownership tags (google-site-verification, msvalidate.01, yandex-verification). */
verification?: VerificationMetadata
}
type BuildMetadataArgs = {
@@ -122,6 +125,8 @@ type BuildMetadataArgs = {
siteName?: null | string
/** slug per locale for this document — drives canonical + hreflang. */
slugs: LocalizedSlugs
/** Site Settings → Search & AI verification codes; rendered as <meta> tags by Next. */
verification?: VerificationMetadata
}
/**
@@ -151,6 +156,7 @@ export function buildMetadata({
siteDescription,
siteName,
slugs,
verification,
}: BuildMetadataArgs): PageMetadata {
// Title source priority: titleOverride (exact, wins outright) > meta.title
// (SEO title an editor set) > pageTitle (the document's own name). This means
@@ -203,6 +209,7 @@ export function buildMetadata({
...(description && { description }),
...(ogImage ? { images: [ogImage.url] } : {}),
},
...(verification ? { verification } : {}),
// robots: noindex pages are excluded (follow keeps link authority). Indexed
// pages get generous snippet/preview limits so Google can show rich results
// (long snippets, large image previews, full video previews).