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:
co-authored by
Claude Opus 5.5
parent
12fbd424a5
commit
94e563055f
@@ -4,6 +4,7 @@ import type { I18nConfig } from '../i18n/index.js'
|
||||
|
||||
import { archiveFieldName } from '../content/types.js'
|
||||
import { buildLocalizedPath, getLocaleCodes, getLocalizedSlugs } from '../i18n/index.js'
|
||||
import { isSiteNoindex } from './siteNoindex.js'
|
||||
|
||||
/**
|
||||
* IndexNow — tell search engines a URL changed the moment it's published
|
||||
@@ -76,9 +77,14 @@ export function createIndexNowKeyRoute({ getCachedPayload }: { getCachedPayload:
|
||||
}
|
||||
}
|
||||
|
||||
/** True when submissions may leave this machine: production + a public https origin. */
|
||||
/**
|
||||
* True when submissions may leave this machine: production + a public https
|
||||
* origin, and not a staging copy (IPAL_NOINDEX) — a staging build runs with
|
||||
* NODE_ENV=production too, and its URLs must not reach Bing.
|
||||
*/
|
||||
function publicOrigin(baseUrl?: string): null | string {
|
||||
const origin = (baseUrl ?? process.env.NEXT_PUBLIC_SERVER_URL ?? '').replace(/\/$/, '')
|
||||
if (isSiteNoindex()) {return null}
|
||||
if (process.env.NODE_ENV !== 'production' || !/^https:\/\//i.test(origin)) {return null}
|
||||
if (/localhost|127\.0\.0\.1|\.local\b|\.test\b/i.test(origin)) {return null}
|
||||
return origin
|
||||
|
||||
Reference in New Issue
Block a user