From efe23233a0f7682286ece6d6e165687b228da020 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sun, 24 Sep 2023 08:53:15 +0100 Subject: [PATCH] Revert "chore(blog): remove the blog listing page" This reverts commit e37e41254c6724ddf04133820a582fdb844d4797. --- src/pages/blog/index.astro | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/pages/blog/index.astro diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro new file mode 100644 index 00000000..0a503e21 --- /dev/null +++ b/src/pages/blog/index.astro @@ -0,0 +1,32 @@ +--- +import ListingPage from "~/components/ListingPage.astro"; +import PageLayout from "~/layouts/PageLayout.astro"; +import { getCollection } from 'astro:content'; + +const posts = await getCollection('blog'); + +// TODO: show all posts when running locally. +const filteredPosts = posts + .filter((post) => !post.data.draft) + .filter((post) => post.data.date); + +const sortedPosts = filteredPosts + .map((post) => { + const slug = `/blog/${post.slug}`; + + return { item: post, slug }; + }) + .sort( + (a, b) => + new Date(b.item.data.date).valueOf() - + new Date(a.item.data.date).valueOf() + ); +--- + + +

+ This is where I publish my personal blog posts as well as technical posts + and tutorials on topics such as Drupal, PHP, Tailwind CSS, automated + testing, and systems administration. +

+