---
import { getCollection } from 'astro:content'

import ArticleLayout from '../../layouts/ArticleLayout.astro'

export async function getStaticPaths() {
    const blogEntries = await getCollection('guides')
    return blogEntries.map(entry => ({
        params: { id: entry.data.id },
        props: { entry },
    }))
}

const { entry } = Astro.props
const { Content } = await entry.render()
---

<ArticleLayout {...entry.data} pageName={['guide', entry.data.id, entry.data.series && 'series']}>
    <h1>{entry.data.title}</h1>
    {entry.data.series && <div class="series">Serie: {entry.data.series}</div>}
    <Content />
</ArticleLayout>
