add support for page sections on generic pages

This commit is contained in:
2024-06-21 23:13:15 +02:00
parent 82f451cb14
commit 41f5297a12
16 changed files with 683 additions and 93 deletions
+7 -4
View File
@@ -3,6 +3,7 @@ import { GenericFragment } from "@/gql/graphql";
import { getClient } from "@/app/client";
import { Blocks } from "@/components/blocks/Blocks";
import { notFound } from "next/navigation";
import { PageHeader } from "@/components/general/PageHeader";
export const dynamicParams = false;
@@ -12,6 +13,7 @@ const GenericFragmentDefinition = graphql(`
id
urlPath
title
lead
body {
...Blocks
}
@@ -70,12 +72,13 @@ export default async function Page({ params }: { params: { url: string[] } }) {
if (!page) {
return notFound();
}
return (
<main className="site-main" id="main">
<section className="page-header">
<h1>{page.title}</h1>
</section>
<PageHeader
heading={page.title}
lead={page.lead}
/>
<Blocks blocks={page.body} />
</main>
);