28 lines · 720 B · Text
RawDownload
---export const prerender = true;import { getCollection, render } from "astro:content";import BlogPostLayout from "../../layouts/BlogPostLayout.astro"; export async function getStaticPaths() {  const posts = await getCollection("blog", ({ data }) => !data.draft);  return posts.map((post) => ({    params: { slug: post.id },    props: { post },  }));} const { post } = Astro.props;const { Content } = await render(post);--- <BlogPostLayout  title={post.data.title}  description={post.data.description}  date={post.data.date}  author={post.data.author}  authorHandle={post.data.authorHandle}  authorRole={post.data.authorRole}  authorAvatar={post.data.authorAvatar}>  <Content /></BlogPostLayout>