--- import { getCollection, render, type CollectionEntry } from "astro:content"; import { Icon } from "astro-icon/components"; import Layout from "../../layouts/Layout.astro"; export const prerender = true; export async function getStaticPaths() { const posts = await getCollection("posts"); return posts.map((post: CollectionEntry<"posts">) => ({ params: { slug: post.id }, props: { post }, })); } const { post }: { post: CollectionEntry<"posts"> } = Astro.props; const { Content } = await render(post); ---

{post.data.title}

{/* Back button */} Back
{ post.data.tags && post.data.tags.length > 0 && (
{post.data.tags.map((tag: string) => (
{tag}
))}
) }