--- import { type CollectionEntry, getCollection } from "astro:content"; import PageLayout from "@layouts/PageLayout.astro"; import Container from "@components/Container.astro"; import FormattedDate from "@components/FormattedDate.astro"; import { readingTime } from "@lib/utils"; import BackToPrev from "@components/BackToPrev.astro"; export async function getStaticPaths() { const posts = (await getCollection("blog")) .filter(post => !post.data.draft) .sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf()); return posts.map((post) => ({ params: { slug: post.slug }, props: post, })); } type Props = CollectionEntry<"blog">; const post = Astro.props; const { Content } = await post.render(); ---
Back to blog
•
{readingTime(post.body)}
{post.data.title}