0621fb27db
- Add generic JSON-LD injector component and builders - components/seo/JsonLd.tsx - lib/seo/jsonld.ts - Inject Organization and WebSite JSON-LD globally in [lang]/layout - Inject WebApplication JSON-LD on the localized home page - Localize description/url/inLanguage and set alternateName ["PrivyDrop", "PrivyDrop APP"] - Inject FAQPage JSON-LD only on /[lang]/faq (not on home) - Build Q&A from messages.text.faqs - Inject BlogPosting + BreadcrumbList on blog post pages - Use frontmatter.cover as image, localized breadcrumbs Notes - Use stable @id anchors (/#organization, /#website, /[lang]#app, /[lang]/blog/[slug]#post) - Respect multi-language setup across en/zh/ja/es/de/fr/ko - SameAs limited to GitHub and X as provided - Site URL resolved via NEXT_PUBLIC_SITE_URL or defaults to https://www.privydrop.app
24 lines
524 B
TypeScript
24 lines
524 B
TypeScript
import React from "react";
|
|
|
|
type JsonLdProps = {
|
|
data: Record<string, any> | Record<string, any>[];
|
|
id?: string;
|
|
};
|
|
|
|
export default function JsonLd({ data, id }: JsonLdProps) {
|
|
const blocks = Array.isArray(data) ? data : [data];
|
|
return (
|
|
<>
|
|
{blocks.map((item, idx) => (
|
|
<script
|
|
key={id ? `${id}-${idx}` : idx}
|
|
type="application/ld+json"
|
|
suppressHydrationWarning
|
|
dangerouslySetInnerHTML={{ __html: JSON.stringify(item) }}
|
|
/>
|
|
))}
|
|
</>
|
|
);
|
|
}
|
|
|