Summer pricing is live: save $50 on Starwind Pro lifetime access.
Theme
src/pages/blog/[slug].astro
import { getCollection } from "astro:content";
export async function getStaticPaths() {
const posts = await getCollection("blog");
// Map each post to a path with its slug
return posts.map((post) => ({
params: { slug: post.slug },
props: { post },
}));
}
Starwind Dependencies
Sign in to view code and copy install commands.
Sign inThis component requires Starwind Pro.
Get lifetime access to all premium components, updates, and priority support.
Upgrade to ProFailed to load code. Please try again.