Minor post fixes. Makes posts publishable with a date
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user