--- import { getCollection, render } from 'astro:content'; import Layout from '../../layouts/Layout.astro'; export async function getStaticPaths() { const posts = await getCollection('posts'); return posts.map(post => ({ params: { slug: post.id }, props: { post } })); } const { post } = Astro.props; const { Content } = await render(post); function formatDate(date: Date): string { const d = String(date.getDate()).padStart(2, '0'); const m = String(date.getMonth() + 1).padStart(2, '0'); const y = String(date.getFullYear()).slice(-2); return `${d}/${m}/${y}`; } ---

{post.data.title}

{formatDate(post.data.date)}