From 862d2a8b6fa35a3f4cd55f13f7fa7094c34bdfe0 Mon Sep 17 00:00:00 2001 From: John Costa Date: Thu, 27 Jul 2023 22:57:12 +0100 Subject: [PATCH] FIX: Title and order of posts --- src/pages/blog.astro | 6 +++--- src/pages/posts/i-build-a-parser.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/blog.astro b/src/pages/blog.astro index 3418078..58ecfc1 100644 --- a/src/pages/blog.astro +++ b/src/pages/blog.astro @@ -2,10 +2,10 @@ import Navbar from '../components/Navbar.astro' const posts = await Astro.glob('./posts/*.md'); -const sortedPosts = posts.sort((a, b) => { +posts.sort((a, b) => { const splitA = a.frontmatter.date.split("/"); const splitB = b.frontmatter.date.split("/"); - return new Date(splitB[1], splitB[0], splitB[2]).getTime() - new Date(splitA[1], splitA[0], splitA[2]).getTime() + return new Date(splitB[2], splitB[1], splitB[0]).getTime() - new Date(splitA[2], splitA[1], splitA[0]).getTime() }); --- @@ -16,7 +16,7 @@ const sortedPosts = posts.sort((a, b) => {