Files
EpicNext-Cms/src/components/public/json-ld.tsx
T
openhands 30583b8e2e
CI / check (push) Successful in 29s
CI / tests-unit (push) Successful in 2m17s
CI / tests-integration (push) Successful in 2m29s
CI / tests-imaging-browsers (push) Successful in 2m32s
CI / tests-quality (push) Failing after 2m18s
CI / tests-ui (push) Successful in 5m14s
CI / preflight (push) Skipped
CI / deploy (push) Successful in 2m41s
feat(seo): add JSON-LD, OG images and RSS feed for news
2026-10-22 18:22:32 +02:00

22 lines
460 B
TypeScript

/**
* Renders schema.org JSON-LD. The payload is data, not executable script, but
* `<` is escaped so an article title can never terminate the tag early.
*/
export function JsonLd({
data,
nonce,
}: {
data: Record<string, unknown> | Record<string, unknown>[];
nonce?: string;
}) {
return (
<script
type="application/ld+json"
nonce={nonce}
dangerouslySetInnerHTML={{
__html: JSON.stringify(data).replace(/</g, "\\u003c"),
}}
/>
);
}