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
+4 -2
View File
@@ -1,10 +1,11 @@
import { notFound } from "next/navigation";
import type { Metadata } from "next";
import { getSimpleContentPageBySlug } from "@/services/legal.service";
import { createPageMetadata, getPageSEO } from "@/services/seo.service";
import PageSEO from "@/components/layout/PageSEO";
export async function generateMetadata(): Promise<Metadata> {
const page = await getSimpleContentPageBySlug("privacy-policy").catch(() => null);
return { title: page?.title ?? "隐私政策" };
return createPageMetadata(await getPageSEO("core.SimpleContentPage", "privacy-policy").catch(() => null), "隐私政策");
}
export default async function PrivacyPolicyPage() {
@@ -16,6 +17,7 @@ export default async function PrivacyPolicyPage() {
return (
<article className="mx-auto max-w-3xl px-6 py-24">
<PageSEO type="core.SimpleContentPage" slug="privacy-policy" />
<h1 className="mb-8 text-4xl font-bold text-slate-900">{page.title}</h1>
{/* page.body 为 Wagtail RichTextField 渲染出的 HTML,内容仅由后台编辑人员维护,非用户输入,可信任直接渲染 */}
<div