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) => {
- {sortedPosts.map((post) => ( + {posts.map((post) => (

{post.frontmatter.title}

{post.frontmatter.description}

diff --git a/src/pages/posts/i-build-a-parser.md b/src/pages/posts/i-build-a-parser.md index a9763a9..a2db751 100644 --- a/src/pages/posts/i-build-a-parser.md +++ b/src/pages/posts/i-build-a-parser.md @@ -1,6 +1,6 @@ --- layout: "../../layouts/post.astro" -title: "I build a Parser!" +title: "I built a parser!" date: "27/07/2023" ---