feat: render CMS SEO metadata and refresh published page caches
This commit is contained in:
@@ -3,13 +3,11 @@ import { getContactPage } from "@/services/page.service";
|
||||
import { getPreviewOrFallback } from "@/services/preview.service";
|
||||
import { BlockRenderer } from "@/blocks/BlockRenderer";
|
||||
import type { ContactPageDetail } from "@/types/wagtail";
|
||||
import { createPageMetadata, getPageSEO } from "@/services/seo.service";
|
||||
import PageSEO from "@/components/layout/PageSEO";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const page = await getContactPage().catch(() => null);
|
||||
return {
|
||||
title: page?.seo_title_override || page?.title || "联系我们",
|
||||
description: page?.seo_description_override,
|
||||
};
|
||||
return createPageMetadata(await getPageSEO("core.ContactPage", "contact").catch(() => null), "联系我们");
|
||||
}
|
||||
|
||||
export default async function ContactPage() {
|
||||
@@ -36,5 +34,5 @@ export default async function ContactPage() {
|
||||
);
|
||||
}
|
||||
|
||||
return <BlockRenderer blocks={contactPage.body} />;
|
||||
return <><PageSEO type="core.ContactPage" slug="contact" /><BlockRenderer blocks={contactPage.body} /></>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user