Files
nicco.io/src/pages/[...page].astro
T
2026-06-28 19:09:30 +02:00

20 lines
452 B
Plaintext

---
import { getCollection, render as renderEntry } from 'astro:content'
import PageWithTitle from '../layouts/PageWithTitle.astro'
export async function getStaticPaths() {
const posts = await getCollection('page')
return posts.map((post) => ({
params: { page: post.id },
props: post,
}))
}
const post = Astro.props
const { Content } = await renderEntry(post)
---
<PageWithTitle title={post.data.title}>
<Content />
</PageWithTitle>