From 4161ecbe7c20a153708792ebd91dffc8623422d0 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sun, 11 Dec 2022 00:39:51 +0000 Subject: [PATCH] fix: ensure that the slug is a string Ensure that the last part of the permalink is used as the slug. --- website/src/pages/archive/[year]/[month]/[day]/[slug].astro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/src/pages/archive/[year]/[month]/[day]/[slug].astro b/website/src/pages/archive/[year]/[month]/[day]/[slug].astro index aaf4e01b..cdf5cb71 100644 --- a/website/src/pages/archive/[year]/[month]/[day]/[slug].astro +++ b/website/src/pages/archive/[year]/[month]/[day]/[slug].astro @@ -11,13 +11,13 @@ export async function getStaticPaths() { const slug = email.frontmatter.permalink .replace('archive/', '') .replace('\n', '') - .split('/')[3] as string + const slugParts = slug.split('/') return { params: { day: pubDate[2], month: pubDate[1], - slug, + slug: slugParts.reverse()[0], year: pubDate[0], }, props: {