--- import { getCollection, render } from "astro:content"; import PostLayout from "@/layouts/PostLayout.astro"; export async function getStaticPaths() { const posts = await getCollection("posts", ({ data }) => !data.draft); return posts.map((post) => ({ params: { slug: post.id }, props: { post }, })); } const { post } = Astro.props; const { Content } = await render(post); const wordCount = post.body?.split(/\s+/).length ?? 0; const minutes = Math.max(1, Math.round(wordCount / 220)); const readingTime = `${minutes} min read`; ---