Minor post fixes. Makes posts publishable with a date

This commit is contained in:
2025-06-26 14:57:34 -07:00
parent 6a97302539
commit b93123a8c9
4 changed files with 24 additions and 19 deletions

View File

@@ -5,9 +5,11 @@ import { getCollection } from 'astro:content';
import FormattedDate from '../../components/FormattedDate.astro';
import { Image } from 'astro:assets';
const posts = (await getCollection('blog')).sort(
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf(),
);
const posts = (await getCollection('blog'))
.filter(p => p.data.pubDate)
.sort(
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf(),
);
---
<RootLayout>