--- import { getCollection } from 'astro:content'; import Base from '../../layouts/Base.astro'; const title = 'Blog — Green Tea.'; const description = 'Notes on building a zen, opinionated, type-safe HTTP framework.'; const posts = (await getCollection('blog', ({ data }) => !data.draft)).sort( (a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf() ); const dateFormat = new Intl.DateTimeFormat('en-US', { month: 'long', day: 'numeric', year: 'numeric', timeZone: 'UTC', }); --- Blog From the garden { posts.length === 0 ? ( No posts yet. ) : ( {posts.map((post) => ( {post.data.title} {dateFormat.format(post.data.pubDate)} {post.data.description} {post.data.tags && post.data.tags.length > 0 && ( {post.data.tags.map((tag) => ( {tag} ))} )} ))} ) }
Blog
No posts yet.
{dateFormat.format(post.data.pubDate)}
{post.data.description}
{post.data.tags.map((tag) => ( {tag} ))}