--- import { getCollection, 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.slug }, props: { post }, })); } const { post }: { post: CollectionEntry<'posts'> } = Astro.props; const { Content } = await post.render(); ---

{post.data.title}

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