Code Block 1 - Static Wrapper
Free
A lightweight syntax highlighted code block wrapper powered by Astro's built-in Code component.
Theme
My Themes
Local Save
Built-in Themes
Default
Amber Minimal
Aurora
Blue Shift
Cyberpunk
Darkmatter
Espresso
Event Horizon
Monochrome
Nature
Nightshade
Overclock
Soft Lavender
Twitter
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 },
}));
} Loading code...
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.