My blog
-
{
posts.map((post) => (
- {post.data.title} )) }
--- import { getCollection } from 'astro:content'; import BaseHead from '../../components/BaseHead.astro'; import Header from '../../components/Header.astro'; import Footer from '../../components/Footer.astro'; const posts = (await getCollection('blog')).sort( (a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf() ); ---