We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 777124a commit 6c76395Copy full SHA for 6c76395
src/pages/blog/[...slug].astro
@@ -1,21 +1,20 @@
1
---
2
import { type CollectionEntry, getCollection } from 'astro:content';
3
import BlogPost from '../../layouts/BlogPost.astro';
4
-//import { render } from 'astro:content';
5
6
export async function getStaticPaths() {
7
const posts = await getCollection('blog');
8
return posts.map((post) => ({
9
- params: { slug: post.id },
+ params: { slug: post.slug },
10
props: post,
11
}));
12
}
13
type Props = CollectionEntry<'blog'>;
14
15
const post = Astro.props;
16
-const { Content } = await render(post);
+const { Content } = await post.render();
17
18
19
<BlogPost {...post.data}>
20
<Content />
21
-</BlogPost>
+</BlogPost>
0 commit comments