SEO/AEO
This commit is contained in:
23
src/components/SeoJsonLd.tsx
Normal file
23
src/components/SeoJsonLd.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import React from 'react';
|
||||
|
||||
interface SeoJsonLdProps {
|
||||
data: object | object[];
|
||||
}
|
||||
|
||||
export default function SeoJsonLd({ data }: SeoJsonLdProps) {
|
||||
const jsonLdArray = Array.isArray(data) ? data : [data];
|
||||
|
||||
return (
|
||||
<>
|
||||
{jsonLdArray.map((item, index) => (
|
||||
<script
|
||||
key={index}
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: JSON.stringify(item, null, 0),
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user