diff --git a/src/pages/blog.astro b/src/pages/blog.astro
index 3743c08..b544cd1 100644
--- a/src/pages/blog.astro
+++ b/src/pages/blog.astro
@@ -1,7 +1,6 @@
---
+import { getCollection } from 'astro:content';
import BaseLayout from '../layouts/BaseLayout.astro';
-import EntryList from '../components/EntryList.astro';
-import { getAllEntries } from '../lib/entries';
import {
buildOgImage,
buildBreadcrumbs,
@@ -9,14 +8,23 @@ import {
absoluteUrl,
} from '../lib/seo';
-const posts = (await getAllEntries()).filter((e) => e.type === 'post');
-const lastUpdated = posts[0]?.date;
+const posts = (await getCollection('posts')).sort(
+ (a, b) => b.data.date.valueOf() - a.data.date.valueOf()
+);
+const lastUpdated = posts[0]?.data.date;
+
+const fmt = new Intl.DateTimeFormat('en-US', {
+ year: 'numeric',
+ month: 'short',
+ day: 'numeric',
+ timeZone: 'UTC',
+});
const description = 'Longer-form notes from Unique — essays and meta about the project.';
const ogImage = buildOgImage(undefined, 'posts', 'Unique blog');
const itemList = buildItemList(
- posts.map((p) => ({ url: p.href, name: p.primary })),
+ posts.map((p) => ({ url: `/posts/${p.id}/`, name: p.data.title })),
'Posts on Unique'
);
@@ -45,12 +53,72 @@ const breadcrumbs = buildBreadcrumbs([
jsonLd={[blogSchema, itemList, breadcrumbs]}
>
{posts.length > 0 ? (
-
Nothing yet — check back soon.
)}