feat: render CMS SEO metadata and refresh published page caches

This commit is contained in:
2026-10-11 18:05:47 +08:00
parent a8e2863cc4
commit 870b9b4282
19 changed files with 310 additions and 35 deletions
+14
View File
@@ -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"),
}}
/>
);
}