--- import Layout from '@/layouts/Layout.astro' import { getPinnedPosts, getPostsByYear } from '@/utils/content' const pinnedPosts = await getPinnedPosts() const postsByYear = await getPostsByYear() ---
{pinnedPosts.length > 0 && (
)} {[...postsByYear.entries()].map(([year, posts]) => ( // Year Group
{/* Year */} {/* Posts List */}
    {posts.map(post => ( // Single Post
  • {/* Post Title */} {post.data.title} {/* Post Date */}
  • ))}
))}