feat: render CMS SEO metadata and refresh published page caches
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { getPageSEO } from "@/services/seo.service";
|
||||
|
||||
export default async function PageSEO({ type, slug }: { type: string; slug?: string }) {
|
||||
const page = await getPageSEO(type, slug).catch(() => null);
|
||||
if (!page?.schema_json || Object.keys(page.schema_json).length === 0) return null;
|
||||
return (
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: JSON.stringify(page.schema_json).replace(/</g, "\\u003c"),
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user