--- import { getCollection } from 'astro:content'; import Layout from '../../layouts/Layout.astro'; import { formatDate } from '../../lib/format'; import { organizePostsByCategory } from '../../lib/posts'; import { getSlug } from '../../utils'; const posts = await getCollection('md', ({ data }) => data.draft !== true); const { grouped, categories: sortedCategories } = organizePostsByCategory(posts); --- {sortedCategories.map(category => (
{category}
 `${formatDate(post.data.date)}    ${post.data.title}${post.data.pinned ? ' [pinned]' : ''}`).join('\n')} />
))}