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
+11 -1
View File
@@ -6,6 +6,7 @@ import type { SiteIndexEntry } from './siteIndex.js'
import { blocksToMarkdown } from '../content/blocksToMarkdown.js'
import { getLocaleDefinition, isValidLocale } from '../i18n/index.js'
import { llmsIntroFrom } from './searchSettings.js'
import { collectSiteIndex } from './siteIndex.js'
type BuildLlmsTxtArgs = {
@@ -25,6 +26,8 @@ type BuildLlmsTxtArgs = {
* convention. Default false = the compact index (links + descriptions).
*/
full?: boolean
/** Only pages whose path passes — e.g. those open while the site is under construction. */
include?: (path: string) => boolean
/** Field holding the block layout (full mode only). Default 'layout'. */
layoutField?: string
/**
@@ -45,6 +48,7 @@ type BuildLlmsTxtArgs = {
}
type SettingsShape = {
[key: string]: unknown
siteDescription?: null | string
siteName?: null | string
}
@@ -57,7 +61,8 @@ const day = (iso?: string) => (iso ? iso.slice(0, 10) : undefined)
* buildSitemapEntries: the plugin already knows the site's name, description,
* and pages, so it can generate this automatically.
*
* Structure (llmstxt.org): H1 site name, a blockquote summary, then — per
* Structure (llmstxt.org): H1 site name, a blockquote summary, the editor's
* note from Site Settings → Search & AI (when set), then — per
* language when the site has several — one list per collection (pages first,
* then archive collections such as a blog) of Markdown links with descriptions.
* Section names are the project's own locale and collection labels; the plugin
@@ -74,6 +79,7 @@ export async function buildLlmsTxt({
config,
content,
full = false,
include,
layoutField = 'layout',
locale,
pagesSlug = 'pages',
@@ -99,6 +105,7 @@ export async function buildLlmsTxt({
config,
content,
depth: full ? 1 : 0,
include,
locales,
pagesSlug,
payload,
@@ -108,6 +115,9 @@ export async function buildLlmsTxt({
const lines: string[] = [`# ${name}`, '']
if (description) {lines.push(`> ${description}`, '')}
// Site Settings → Search & AI: facts the editor wants assistants to know and quote.
const intro = llmsIntroFrom(settings)
if (intro) {lines.push(intro, '')}
const multi = locales.length > 1
for (const loc of locales) {