--- import { getCollection } from 'astro:content'; const allPosts = await getCollection('blog'); const publishedPosts = allPosts .filter((post) => !post.data.draft) .sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime()) .slice(0, 3); const isSingle = publishedPosts.length === 1; --- {publishedPosts.length > 0 && (

From the Blog

All Posts
{publishedPosts.map((post) => { const formattedDate = new Date(post.data.pubDate).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric', }); return (
{post.data.tags.length > 0 && (
{post.data.tags.slice(0, 2).map((tag: string) => ( {tag} ))}
)}

{post.data.title}

{post.data.description}

); })}
)}