--- import { getCollection } from 'astro:content'; import BaseLayout from '../../layouts/BaseLayout.astro'; import FeaturedBlogPost from '../../components/FeaturedBlogPost.astro'; import BlogPostCard from '../../components/BlogPostCard.astro'; const includeDrafts = import.meta.env.DEV || import.meta.env.PUBLIC_INCLUDE_DRAFTS === 'true'; const posts = (await getCollection('blog')) .filter((post) => includeDrafts || !post.data.draft) .sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()); const featuredPost = posts.find((post) => post.data.featured) ?? posts[0]; const remainingPosts = featuredPost ? posts.filter((post) => post.id !== featuredPost.id) : []; ---
Blog

Blog

Release notes, tutorials, and project updates.

{posts.length > 0 ? ( <> {/* Featured post */} {featuredPost && (
)} {/* Remaining posts grid */} {remainingPosts.length > 0 && (
{remainingPosts.map((post) => ( ))}
)} ) : (

No posts yet. Check back soon!

)}