firq-dev-website/src/pages/blog/[...slug].astro

21 lines
437 B
Text
Raw Normal View History

2024-07-19 22:52:15 +02: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() {
const blogEntries = await getCollection('blog')
2024-07-19 22:52:15 +02:00
return blogEntries.map((entry) => ({
params: { slug: entry.id },
props: { entry },
}))
2024-07-19 22:52:15 +02:00
}
const { entry } = Astro.props
const { Content } = await render(entry)
2024-07-19 22:52:15 +02:00
---
<BlogPost frontmatter={entry.data}>
<Content />
</BlogPost>