Merge main (security-perf + SEO) into docs; finish English docs and agent guide

- Resolve conflicts in analytics, consent, content, i18n, mcp and stats,
  keeping the docs fixes and the new code behaviour, verified against src
- Translate the remaining 14 module pages, ipal-seo-check skill and script
- Integrate the security-perf and SEO agent-guide text: getRobots,
  isPathVisible, Search & AI (DNS verification first, meta fields optional),
  sitemap index/cache/503, consentMode basic/advanced, policyVersion,
  globalOverrides, revalidatePath / buildGlobalRevalidateHook, authAccess,
  firstUserAdmin, allowCollectionMismatch, unknown-IP rate limit; stale
  claims fixed across AGENT.md, skills, frontend, developer guide, vibe
- docsConsistency: pending list removed (all docs English); relative links
  now also check #anchors

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-22 17:59:52 +02:00
co-authored by Claude Opus 5.5
107 changed files with 5476 additions and 2541 deletions
+16 -8
View File
@@ -33,15 +33,19 @@ and shared by the helpers (generateMetadata and the page share queries).
| `pagesSlug` | `'pages'` | pages collection |
| `settingsSlug` | `'site-settings'` | SiteSettings global |
| `redirectCollections` | `[{ slug: 'pages' }]` | collections checked by `resolvePageRedirect` (slug history) |
| `markdown` | — | `{ frontmatter, layoutField, overrides }` for `markdownRoute` |
| `markdown` | — | `{ frontmatter, layoutField, overrides, isPathVisible }` for `markdownRoute` (`isPathVisible` defaults to the helper below; `() => true` = no construction filter) |
| `markdownAlternate` | off | `true`/prefix → `generatePageMetadata` adds `<link rel="alternate" type="text/markdown">` (indexable pages) |
| `mcp` | — | `{ serverName, serverVersion, rateLimit, maxBatch, clientIp }` for `mcpGET`/`mcpPOST` (mcp.md) |
| `mcp` | — | `{ serverName, serverVersion, rateLimit, maxBatch, clientIp, isPathVisible }` for `mcpGET`/`mcpPOST` (mcp.md) |
| `pageJsonLd` | — | default `getPageJsonLd` options: `breadcrumbs`, `entryType`, `entries`, `faq`, `pageType` |
| `robots` | — | `RobotsOptions` for `robots` (seo.md) |
| `robots` | — | `RobotsOptions` for `robots` and `getRobots` (seo.md); `aiBotRules: [{ userAgent, access }]` = per-bot exceptions from code (the panel's rules come after them) |
| `settingsDepth` | `1` | depth of `getSettings`: Site Settings relations arrive as documents, theirs as ids (the archive page is read separately at depth 2); `2` = every request pays for more |
| `siteJsonLd` | WebSite + Organization from Site Settings | a function replaces it, `false` = none |
| `sitemapEntries` | — | `(entries) => entries` — final sitemap list: add URLs of your own routes, remove some, set `priority` |
| `sitemapImages` | the document's SEO image | `(doc) => url[]` |
| `sitemapOptions` | `{ maxUrls: 10000, cacheControl: 'public, max-age=0, s-maxage=3600, stale-while-revalidate=86400', memoSeconds: 300 }` | `sitemapRoute`: above `maxUrls` it serves a `<sitemapindex>` with `?part=N` parts (`Infinity` = never split); `cacheControl: false` = no header; `memoSeconds: 0` = no in-process memo |
| `sitemapStyle` | built-in style | `false` = raw XML |
| `summaryField` | — | field from `buildSummaryField` for llms.txt / MCP |
| `underConstructionSeo` | `true` | under construction the sitemap and llms.txt list only the open pages; `false` = list everything |
### Returned keys (what `@/lib/content` exports)
@@ -49,16 +53,17 @@ and shared by the helpers (generateMetadata and the page share queries).
|---|---|
| `getCachedPayload` | `() => Promise<Payload>` |
| `getConfiguredLocales` | `() => Promise<string[]>` (from `config.localization`) |
| `getSettings` | `(locale)` — SiteSettings, `depth: 2`, one read per language per request |
| `getSettings` | `(locale)` — SiteSettings, `depth: 1` (`settingsDepth`), one read per language per request |
| `resolveRoute` | `(locale, segments, page)` → `ResolvedRoute \| null` (content.md) |
| `getEntries` | `(collection, locale, page, perPage)` → `ArchiveEntries` |
| `getNotFoundPage` | `(locale)` — 404 page from System Pages or `null`, does not throw (pages.md) |
| `generatePageMetadata` | `(locale, segments, page = 1)` → `Metadata` for `generateMetadata` |
| `getPageJsonLd` | `(locale, segments, options?)` → nodes for `<JsonLdGraph>` (WebPage / BlogPosting / CollectionPage, BreadcrumbList, FAQPage); `[]` for noindex |
| `generateStaticParams` | see below |
| `sitemap` | `app/sitemap.ts`: `export { sitemap as default }` (database error → `[]`) |
| `sitemap` | `app/sitemap.ts`: `export { sitemap as default }` (does not split; a database error throws at runtime, `[]` only during `next build`) |
| `sitemapRoute` | `app/sitemap.xml/route.ts`: `export { sitemapRoute as GET }` |
| `robots` | `app/robots.ts`: `export { robots as default }` |
| `robots` | `app/robots.ts`: `export { robots as default }` — rules from code only (sync) |
| `getRobots` | `app/robots.ts`: `export { getRobots as default }` + `export const dynamic = 'force-dynamic'` — `robots` plus the AI crawler policy and per-bot rules from Site Settings → Search & AI, read per request; database unreachable → the code options |
| `manifest` | `app/manifest.ts`: `export { manifest as default }` |
| `llmsRoute`, `llmsFullRoute` | `app/llms.txt/route.ts`, `app/llms-full.txt/route.ts` (seo.md) |
| `markdownRoute` | `app/md/[locale]/[[...slug]]/route.ts` (content.md) |
@@ -70,13 +75,14 @@ and shared by the helpers (generateMetadata and the page share queries).
| `resolveLink`, `resolveNav`, `getSystemLinks` | links.md |
| `resolvePageRedirect` | `(locale, segments)` → new path from slug history or `null` |
| `getConstructionMode` | `(locale)` — under-construction mode state (construction.md) |
| `isPathVisible` | `(path, locale)` → `Promise<boolean>` — `false` for a page construction mode hides (path as a visitor sees it, `/pl/o-nas`); already wired into `markdownRoute` and `mcpPOST`, pass it to `createSearchRoute({ …, isPathVisible })`; concurrent calls share one mode read per locale |
| `getFormTexts` | `(locale)` — form texts from Notifications |
| `getSiteShell` | `(locale)` → `SiteShell` for the layout (consent, analytics, turnstile, jsonLd, settings, theme, formTexts) |
| `i18n` | the `I18nConfig` passed in |
### `generateStaticParams` — what it really generates
The docstring in `createContentHelpers.ts` (~470) talks about content collections, but the code (~512–518)
The docstring of `generateStaticParams` in `createContentHelpers.ts` talks about content collections, but the code
queries **only the `pagesSlug` collection**, `limit: 1000` per language, no pagination:
- home page → `slug: []` (root); the page assigned as 404 and the slugs `404`/`500`/`error`/`not-found` are skipped,
@@ -162,5 +168,7 @@ It does not mount `AlternateLinksProvider` (i18n.md) — add it yourself if you
- Any key from `createContentHelpers` can be left out of the destructuring or replaced with your own function
of the same name in `src/lib/content.ts` (e.g. your own `generateStaticParams` with entries).
- `createPageRoute`: your own view through `render`, your own 404/redirect through `onMissing`, extra block props through `blockProps`, JSON-LD through `jsonLd`.
- `SiteProviders`: `banner`, `cookieButton`, `analytics` accept your own element or `false`.
- `SiteProviders`: `banner`, `cookieButton`, `analytics` accept your own element or `false`; `analytics={{ consentMode: 'basic' }}` = no request to Google before consent (default `'advanced'`: the tag loads with every signal `denied`).
- Search & AI from the panel: `robots` instead of `getRobots` ignores it; your own robots: `buildRobots({ ...robotsOptionsFrom(settings), … })`; drop the verification tags: `const { verification, ...meta } = await generatePageMetadata(…)`.
- Construction filter in Markdown / MCP: `markdown: { isPathVisible: () => true }`, `mcp: { isPathVisible: () => true }`; in the sitemap and llms.txt: `underConstructionSeo: false`.
- `createPageRoute` pagination and the `generateStaticParams` scope currently cannot be changed with an option — only with your own code.