feat: render CMS content fields and footer settings
This commit is contained in:
@@ -6,6 +6,7 @@ import { BlockRenderer } from "@/blocks/BlockRenderer";
|
||||
import type { SolutionPageDetail } from "@/types/wagtail";
|
||||
import { createPageMetadata, getPageSEO } from "@/services/seo.service";
|
||||
import PageSEO from "@/components/layout/PageSEO";
|
||||
import { PageCover } from "@/components/layout/PageContent";
|
||||
|
||||
interface SolutionDetailPageProps {
|
||||
params: Promise<{ slug: string }>;
|
||||
@@ -24,7 +25,7 @@ export default async function SolutionDetailPage({
|
||||
const { slug } = await params;
|
||||
const solution = await getPreviewOrFallback<SolutionPageDetail>(
|
||||
"solutions.solutionpage",
|
||||
"body,industry,summary",
|
||||
"body,industry,summary,cover_image",
|
||||
() => getSolutionBySlug(slug).catch(() => null),
|
||||
);
|
||||
|
||||
@@ -39,8 +40,10 @@ export default async function SolutionDetailPage({
|
||||
{solution.title}
|
||||
</h1>
|
||||
{solution.industry && (
|
||||
<p className="mb-12 text-sm text-slate-500">{solution.industry}</p>
|
||||
<p className="mb-4 text-sm text-slate-500">{solution.industry}</p>
|
||||
)}
|
||||
{solution.summary && <p className="mb-6 text-lg text-slate-600">{solution.summary}</p>}
|
||||
<PageCover image={solution.cover_image} />
|
||||
<BlockRenderer blocks={solution.body} />
|
||||
</article>
|
||||
);
|
||||
|
||||
@@ -3,6 +3,7 @@ import type { Metadata } from "next";
|
||||
import { getSolutionList } from "@/services/solution.service";
|
||||
import { createPageMetadata, getPageSEO } from "@/services/seo.service";
|
||||
import PageSEO from "@/components/layout/PageSEO";
|
||||
import { ColumnHeading, PageCover } from "@/components/layout/PageContent";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
return createPageMetadata(await getPageSEO("solutions.SolutionIndexPage", "solutions").catch(() => null), "解决方案");
|
||||
@@ -14,7 +15,7 @@ export default async function SolutionListPage() {
|
||||
return (
|
||||
<div className="mx-auto max-w-4xl px-6 py-24">
|
||||
<PageSEO type="solutions.SolutionIndexPage" slug="solutions" />
|
||||
<h1 className="mb-12 text-4xl font-bold text-slate-900">解决方案</h1>
|
||||
<ColumnHeading type="solutions.SolutionIndexPage" slug="solutions" fallback="解决方案" />
|
||||
<ul className="space-y-6">
|
||||
{solutions.map((solution) => (
|
||||
<li key={solution.id} className="border-b border-slate-100 pb-6">
|
||||
@@ -24,6 +25,7 @@ export default async function SolutionListPage() {
|
||||
>
|
||||
{solution.title}
|
||||
</Link>
|
||||
<PageCover image={solution.cover_image} compact />
|
||||
{solution.industry && (
|
||||
<p className="mt-1 text-sm text-slate-500">{solution.industry}</p>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user