--- import { getCollection } from 'astro:content'; import { Card, CardContent, CardDescription, CardHeader } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import PostHeader from "@/components/PostHeader.astro"; // Fetch all blog posts from the content collection const posts = await getCollection('blog'); // Sort posts by date (newest first) const sortedPosts = posts.sort((a, b) => new Date(b.data.publishDate).getTime() - new Date(a.data.publishDate).getTime() ); const dateFormatter = new Intl.DateTimeFormat('en-GB', { day: '2-digit', month: 'long', year: 'numeric', }); ---