blob: 9162df44672b89ba3efa230fbb9f0b7d8ea84499 [file] [log] [blame]
Samuel Shuert86826b82024-04-27 16:14:20 -04001---
2import { type CollectionEntry, getCollection } from 'astro:content';
3import BlogPost from '../../layouts/BlogPost.astro';
4
5export async function getStaticPaths() {
Samuel Shuert21af95a2024-04-30 17:49:11 -04006 const posts = await getCollection('post');
Samuel Shuert39632832024-04-29 20:54:19 -04007 return posts.map((post: { slug: any; }) => ({
Samuel Shuert86826b82024-04-27 16:14:20 -04008 params: { slug: post.slug },
9 props: post,
10 }));
11}
Samuel Shuert21af95a2024-04-30 17:49:11 -040012type Props = CollectionEntry<'post'>;
Samuel Shuert86826b82024-04-27 16:14:20 -040013
14const post = Astro.props;
15const { Content } = await post.render();
16---
17
18<BlogPost {...post.data}>
19 <Content />
20</BlogPost>