AI / GEO: - feat(content): lexicalToMarkdown, blocksToMarkdown, createMarkdownRenderer (+markdownResponse) — per-page Markdown for AI agents - feat(content): markdown content negotiation + discovery (prefersMarkdown, markdownHref) - feat(seo): buildRobots aiBots policy (allow/block-training/disallow) - feat(seo): llms-full.txt mode in buildLlmsTxt/createLlmsTxtRoute - feat(mcp): createMcpRoute — read-only MCP server (search_content, get_page) - feat(content): searchContent + createSearchRoute — shared JSON search - feat(seo): buildSpeakableJsonLd + buildSummaryField (aiSummary, auto-fill) Forms: - feat(forms): useForm/useContactForm + validators (logic-only, no markup) - feat(forms): honeypot anti-spam (honeypotInputProps, isHoneypotTripped) Helpers / hardening: - feat(i18n): resolveLocalized — replaces ad-hoc getSafeString - feat(hooks): buildCrossLocaleFieldSync — locales from config, no hardcoded list - feat(seo): buildNoindexField — checkbox → meta.noindex, no - feat(content): resolveRedirect — 301/308 from slugHistory - feat(env): assertEnv + ipalEnvRules — fail-fast env validation - feat(consent): ConsentScript — load third-party only after consent - feat(health): createHealthRoute — Coolify/Docker DB liveness Fixes: - fix(seo): wrap getCachedPayload in try/catch in createManifestHandler (Docker/CI build no longer crashes when DB unreachable) docs: migration.md (20 sections), new env.md/mcp.md, updated agents.md, AGENTS-TEMPLATE.md, forms/hooks/content/seo/consent/deployment/richtext
40 lines
1.5 KiB
TypeScript
40 lines
1.5 KiB
TypeScript
type SpeakableJsonLdArgs = {
|
|
/**
|
|
* CSS selectors marking the parts best suited to be read aloud by voice
|
|
* assistants / AI (a summary, the lead paragraph, key answer). Default
|
|
* ['h1', '.speakable']. Keep it to genuinely readable, self-contained text —
|
|
* not nav or boilerplate.
|
|
*/
|
|
cssSelectors?: string[];
|
|
/** Optional @id to join this node into a @graph (e.g. `${url}#webpage`). */
|
|
id?: string;
|
|
/** Canonical URL of the page this describes. */
|
|
url: string;
|
|
};
|
|
/**
|
|
* Builds WebPage JSON-LD with a `speakable` SpeakableSpecification — tells voice
|
|
* assistants and AI which parts of the page are meant to be read aloud /
|
|
* quoted. A GEO signal: pairs with the Markdown/llms work to make the page's key
|
|
* content easy for assistants to lift cleanly.
|
|
*
|
|
* Add to the page's @graph via JsonLdGraph (recommended) or emit standalone:
|
|
*
|
|
* import { buildSpeakableJsonLd } from '@intecion/ipal-kit'
|
|
* const node = buildSpeakableJsonLd({ url: canonical, cssSelectors: ['h1', '.lead'] })
|
|
*
|
|
* Mark the matching elements in the project markup (e.g. className="speakable"
|
|
* or a `.lead` summary). Selectors that match nothing are simply ignored by
|
|
* consumers — but don't point at nav/boilerplate.
|
|
*/
|
|
export declare function buildSpeakableJsonLd({ id, cssSelectors, url, }: SpeakableJsonLdArgs): {
|
|
speakable: {
|
|
'@type': string;
|
|
cssSelector: string[];
|
|
};
|
|
url: string;
|
|
'@id'?: string | undefined;
|
|
'@context': string;
|
|
'@type': string;
|
|
};
|
|
export {};
|