Sorry! No posts at the minute, coming soon!
}-
{
posts.sort((a, b) => b.data.pubDate - a.data.pubDate).map((post) => (
-
{post.data.title}
))
}
--- import BaseHead from '../../components/BaseHead.astro'; import Header from '../../components/Header.astro'; import Footer from '../../components/Footer.astro'; import { SITE_TITLE, SITE_DESCRIPTION } from '../../consts'; import { getCollection } from 'astro:content'; import FormattedDate from '../../components/FormattedDate.astro'; const posts: any[] = (await getCollection('blog')).sort( (a: any, b: any) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf() ); ---
Sorry! No posts at the minute, coming soon!
}