From 9f0a9a19b47b843d7f8394d0ac961e0dfba05169 Mon Sep 17 00:00:00 2001 From: Cassidy Williams <1454517+cassidoo@users.noreply.github.com> Date: Wed, 27 Dec 2023 01:17:54 -0600 Subject: [PATCH] Fix updated logic for all posts page --- src/pages/posts.astro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/posts.astro b/src/pages/posts.astro index 2f65a5a..7e8169a 100644 --- a/src/pages/posts.astro +++ b/src/pages/posts.astro @@ -10,8 +10,8 @@ import { SITE_TITLE, SITE_DESCRIPTION } from "../config"; // Use Astro.glob() to fetch all posts, and then sort them by date. const posts = (await Astro.glob("../posts/*.md")).sort( (a, b) => - new Date(b.frontmatter.added).valueOf() - - new Date(a.frontmatter.added).valueOf() + new Date(b.frontmatter.updated || b.frontmatter.added).valueOf() - + new Date(a.frontmatter.updated || a.frontmatter.added).valueOf() ); ---