Frontend support for the Hero block; H1 moves out of the hardcoded wrapper
app/[slug]/page.tsx and LivePageContent.tsx no longer render a hardcoded H1 from page.title — that's now the Hero block's job (see HeroBlock.ts's own comment on why). Breadcrumb stays, still built from page.title. Also backfilled /lebensuhr's already-migrated Pages document with a Hero block (order 0) carrying its real headline — without it the page would have lost its H1 entirely once the hardcoded wrapper was removed.
This commit is contained in:
@@ -1293,6 +1293,7 @@ export async function getTrackingCodes(): Promise<TrackingCode[]> {
|
||||
// full page section, not an inline prose element.
|
||||
|
||||
export type PageBlock =
|
||||
| { blockType: "hero"; id: string; headline: string; subline: string | null; ctaLabel: string | null; ctaHref: string | null }
|
||||
| { blockType: "richTextSection"; id: string; content: unknown }
|
||||
| { blockType: "stepRow"; id: string; items: { id: string; icon: string; title: string; subtitle: string | null; description: string }[] }
|
||||
| { blockType: "quote"; id: string; text: string; label: string | null }
|
||||
@@ -1317,6 +1318,7 @@ export type Page = {
|
||||
type PayloadPageImageField = { url?: string | null } | number | null;
|
||||
|
||||
type PayloadPageBlock =
|
||||
| { blockType: "hero"; id: string; headline: string; subline?: string | null; ctaLabel?: string | null; ctaHref?: string | null }
|
||||
| { blockType: "richTextSection"; id: string; content: unknown }
|
||||
| { blockType: "stepRow"; id: string; items: { id: string; icon: string; title: string; subtitle?: string | null; description: string }[] }
|
||||
| { blockType: "quote"; id: string; text: string; label?: string | null }
|
||||
@@ -1358,6 +1360,15 @@ function mapPayloadPageBlock(block: PayloadPageBlock): PageBlock {
|
||||
id: block.id,
|
||||
items: block.items.map((item) => ({ ...item, subtitle: item.subtitle ?? null })),
|
||||
};
|
||||
case "hero":
|
||||
return {
|
||||
blockType: "hero",
|
||||
id: block.id,
|
||||
headline: block.headline,
|
||||
subline: block.subline ?? null,
|
||||
ctaLabel: block.ctaLabel ?? null,
|
||||
ctaHref: block.ctaHref ?? null,
|
||||
};
|
||||
default:
|
||||
return block;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user