add header image to learn posts

This commit is contained in:
saml33 2024-02-07 09:58:59 +11:00
parent 59a2c32237
commit be407ae18e
2 changed files with 17 additions and 4 deletions

View File

@ -77,14 +77,27 @@ async function LearnPostPage({ params }: LearnPostPageProps) {
return notFound()
}
const { category, postTitle, postContent, ctaTitle, ctaDescription, ctaUrl } =
learnPost
const {
category,
postTitle,
postContent,
ctaTitle,
ctaDescription,
ctaUrl,
slug,
} = learnPost
const ctaData = { ctaTitle, ctaDescription, ctaUrl }
const headerImageUrl = `/images/learn/${slug}.png`
return (
<>
<PageHeader title={postTitle} tag={category} showBack />
<PageHeader
backgroundImageUrl={headerImageUrl}
title={postTitle}
tag={category}
showBack
/>
<div className="px-6 lg:px-20 pb-10 md:pb-16 max-w-3xl mx-auto">
<PostDetails post={learnPost} isLearn />
<RichText document={postContent} />

File diff suppressed because one or more lines are too long