fix: use frontmatter

This commit is contained in:
kolaente 2024-07-08 17:40:04 +02:00
parent 7740276cab
commit 21642d36b0
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B

View File

@ -8,7 +8,12 @@ interface Props {
description?: string;
}
const {title, description, image} = Astro.props
// @ts-ignore: Property exists
const title = Astro.props?.frontmatter?.title || Astro.props.title
// @ts-ignore: Property exists
const image = Astro.props?.frontmatter?.image || Astro.props.image
// @ts-ignore: Property exists
const description = Astro.props?.frontmatter?.description || Astro.props.description
---
<Layout title={title} type="text" image={image} description={description}>