diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro
index b047a72..3a9f459 100644
--- a/src/pages/blog/index.astro
+++ b/src/pages/blog/index.astro
@@ -1,12 +1,15 @@
---
import NotchedBox from '../../components/NotchedBox.astro';
import RootLayout from '../../layouts/RootLayout.astro';
-import { getCollection } from 'astro:content';
+import { getCollection, type CollectionEntry } from 'astro:content';
import FormattedDate from '../../components/FormattedDate.astro';
import { Image } from 'astro:assets';
-const posts = (await getCollection('blog'))
- .filter(p => p.data.pubDate)
+function publishedOnly(p: CollectionEntry<'blog'>): p is (CollectionEntry<'blog'> & { data: { pubDate: Date }}) {
+ return p.data.pubDate !== undefined;
+}
+
+const posts = (await getCollection('blog', publishedOnly))
.sort(
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf(),
);
@@ -57,7 +60,8 @@ const posts = (await getCollection('blog'))
{ post.data.description &&
{post.data.description}
-
}
+
+ }