fix: apply seo agent improvements to src/components/seo/JsonLd.tsx
This commit is contained in:
parent
b70ae434a3
commit
491761a4b2
|
|
@ -0,0 +1,19 @@
|
||||||
|
/**
|
||||||
|
* Generic JSON-LD injector for use in Server Components.
|
||||||
|
* Usage:
|
||||||
|
* <JsonLd data={{ '@context': 'https://schema.org', '@type': 'WebSite', ... }} />
|
||||||
|
*/
|
||||||
|
interface Props {
|
||||||
|
data: Record<string, any>
|
||||||
|
id?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function JsonLd({ data, id }: Props) {
|
||||||
|
return (
|
||||||
|
<script
|
||||||
|
id={id}
|
||||||
|
type="application/ld+json"
|
||||||
|
dangerouslySetInnerHTML={{ __html: JSON.stringify(data, null, 2) }}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue