Minor post fixes. Makes posts publishable with a date
This commit is contained in:
1 parent
6a97302539
commit
b93123a8c9
4 files changed
+24
-19
No files matched your search
@@ -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