From bb1b30fc2d2ff8e982768e448fa9cf79b41023e6 Mon Sep 17 00:00:00 2001 From: lew Date: Fri, 23 Jan 2026 00:12:20 +0000 Subject: [PATCH] Add blog post detail page --- apps/blog/src/pages/[slug].astro | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 apps/blog/src/pages/[slug].astro diff --git a/apps/blog/src/pages/[slug].astro b/apps/blog/src/pages/[slug].astro new file mode 100644 index 0000000..8786cb0 --- /dev/null +++ b/apps/blog/src/pages/[slug].astro @@ -0,0 +1,25 @@ +--- +import { getCollection, render } from 'astro:content'; +import '../styles/global.css'; + +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} + +
+

{post.data.title}

+ +
+ +