add: folder structure for markdown content pages

This commit is contained in:
2024-02-29 11:08:31 +01:00
parent a91ad8398d
commit 70ccf24c6b
10 changed files with 198 additions and 47 deletions
+23
View File
@@ -0,0 +1,23 @@
---
import { getCollection } from 'astro:content'
import PageLayout from '../../layouts/PageLayout.astro'
export async function getStaticPaths() {
const blogEntries = await getCollection('guides')
return blogEntries.map(entry => ({
params: { slug: entry.slug },
props: { entry },
}))
}
const { entry } = Astro.props
const { Content } = await entry.render()
---
<h1>{entry.data.title}</h1>
{entry.data.series && <h2>{entry.data.series}</h2>}
<PageLayout title={entry.data.title} description={entry.data.description} pageName={['guide', entry.slug]}>
<Content />
</PageLayout>