---
import Layout from '../layouts/Layout.astro';
import { getCollection } from "astro:content";

export async function getStaticPaths() {
    const pageEntries = await getCollection('pages');
    return pageEntries.map(entry => ({
        params: { slug: entry.slug }, props: { entry },
    }));
}
const { entry } = Astro.props;
const { Content } = await entry.render();

---

<Layout title={entry.data.title} description={entry.data.description} >
    <h1 class="title">{entry.data.title}</h1>
    <div class="content">
        <Content/>
    </div>
</Layout>