-
{
posts.map((post) => (
-
{post.data.heroImage && (
)} {post.data.title}
))
}
--- import { Image } from 'astro:assets'; import { getCollection } from 'astro:content'; import BaseHead from '../../components/BaseHead.astro'; import Footer from '../../components/Footer.astro'; import FormattedDate from '../../components/FormattedDate.astro'; import Header from '../../components/Header.astro'; import { SITE_DESCRIPTION, SITE_TITLE } from '../../consts'; const posts = (await getCollection('blog')).sort( (a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf(), ); ---