2024-07-19 22:52:15 +02:00
|
|
|
---
|
2025-02-06 19:08:51 +01:00
|
|
|
import BlogPost from '@layouts/blogPost.astro'
|
|
|
|
import { getCollection, render } from 'astro:content'
|
2024-07-19 22:52:15 +02:00
|
|
|
|
|
|
|
export async function getStaticPaths() {
|
2025-02-06 19:08:51 +01:00
|
|
|
const blogEntries = await getCollection('blog')
|
2024-07-19 22:52:15 +02:00
|
|
|
|
2025-02-06 19:08:51 +01:00
|
|
|
return blogEntries.map((entry) => ({
|
|
|
|
params: { slug: entry.id },
|
|
|
|
props: { entry },
|
|
|
|
}))
|
2024-07-19 22:52:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
const { entry } = Astro.props
|
2025-02-06 19:08:51 +01:00
|
|
|
const { Content } = await render(entry)
|
2024-07-19 22:52:15 +02:00
|
|
|
---
|
|
|
|
|
2025-02-06 19:08:51 +01:00
|
|
|
<BlogPost frontmatter={entry.data}>
|
|
|
|
<Content />
|
|
|
|
</BlogPost>
|