astro-sw/demo-static/src/pages/blog/[...slug].astro
Ayo cbe210855e
Some checks are pending
Demo / Explore-CI (push) Waiting to run
chore: add new demo-static
2026-05-15 20:25:36 +02:00

17 lines
368 B
Text

---
import { type CollectionEntry, getCollection } from 'astro:content'
export async function getStaticPaths() {
const posts = await getCollection('blog')
return posts.map((post) => ({
params: { slug: post.slug },
props: post,
}))
}
type Props = CollectionEntry<'blog'>
const post = Astro.props
const { Content } = await post.render()
---
<Content />