diff --git a/apps/blog/src/pages/md/[slug].astro b/apps/blog/src/pages/md/[slug].astro new file mode 100644 index 0000000..ff9be4f --- /dev/null +++ b/apps/blog/src/pages/md/[slug].astro @@ -0,0 +1,22 @@ +--- +import { getCollection, render } from 'astro:content'; +import Layout from '../../layouts/Layout.astro'; + +export async function getStaticPaths() { + const posts = await getCollection('posts'); + return posts.map(post => ({ + params: { slug: post.id }, + props: { post } + })); +} + +const { post } = Astro.props; +const { Content } = await render(post); +--- + + +
+

{post.data.title}

+ +
+