--- import BaseLayout from '@/layouts/BaseLayout.astro'; import Pagination from '@/components/Pagination.astro'; import PageHeaderCard from '@/components/PageHeaderCard.astro'; import StatsChart from '@/components/StatsChart.astro'; import { getAllPosts } from '@/lib/posts'; import { getPageSlice } from '@/lib/pagination'; const posts = await getAllPosts(); const pageData = getPageSlice(posts, 1); const archiveStats = [...posts.reduce((months, post) => { const key = `${post.date.getFullYear()}-${String(post.date.getMonth() + 1).padStart(2, '0')}`; months.set(key, (months.get(key) ?? 0) + 1); return months; }, new Map())] .sort(([a], [b]) => a.localeCompare(b)) .map(([label, value]) => ({ label, value })); ---
{pageData.items.map((post) => ( {post.title} ))}