--- import Layout from "../layouts/Layout.astro"; import { getCollection, type CollectionEntry } from "astro:content"; import { Icon } from "astro-icon/components"; // Get all posts from the content collection const posts = await getCollection("posts"); // Sort posts by date, newest first const sortedPosts = posts.sort( (a: CollectionEntry<"posts">, b: CollectionEntry<"posts">) => new Date(b.data.pubDate).valueOf() - new Date(a.data.pubDate).valueOf(), ); function formatDate(date: Date): string { return date.toLocaleDateString("en-us", { month: "short", day: "numeric", year: "numeric", }); } ---

Posts

{/* Mobile: One-sided compact timeline */} {/* Desktop: Dual-sided alternating timeline */} { sortedPosts.length === 0 && (

No posts available yet. Check back soon!

) }