+
diff --git a/app/routes/blog.index.tsx b/app/routes/blog.index.tsx
index b0c41e0a..e493980c 100644
--- a/app/routes/blog.index.tsx
+++ b/app/routes/blog.index.tsx
@@ -41,7 +41,16 @@ const fetchFrontMatters = createServerFn('GET', async () => {
})
)
- return frontMatters
+ return frontMatters.sort((a, b) => {
+ if (!a[1].published) {
+ return 1
+ }
+
+ return (
+ new Date(b[1].published || 0).getTime() -
+ new Date(a[1].published || 0).getTime()
+ )
+ })
// return json(frontMatters, {
// headers: {
@@ -93,7 +102,9 @@ function BlogIndex() {
{format(new Date(published), 'MMM dd, yyyy')}
) : null}
-