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
33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
/**
|
|
* 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 function buildSpeakableJsonLd({ id, cssSelectors = [
|
|
'h1',
|
|
'.speakable'
|
|
], url }) {
|
|
return {
|
|
'@context': 'https://schema.org',
|
|
'@type': 'WebPage',
|
|
...id ? {
|
|
'@id': id
|
|
} : {},
|
|
speakable: {
|
|
'@type': 'SpeakableSpecification',
|
|
cssSelector: cssSelectors
|
|
},
|
|
url
|
|
};
|
|
}
|
|
|
|
//# sourceMappingURL=buildSpeakableJsonLd.js.map
|