From d49cf2cc98eacedc393227d404e2b707672cb6ac Mon Sep 17 00:00:00 2001 From: Dave Smith-Hayes Date: Wed, 3 Jul 2024 22:19:37 -0400 Subject: [PATCH] Add the site meta to the 404 page when looking for posts. --- src/routes/posts.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/routes/posts.tsx b/src/routes/posts.tsx index c14d1d2..c484259 100644 --- a/src/routes/posts.tsx +++ b/src/routes/posts.tsx @@ -15,11 +15,14 @@ app.get('/:slug', async (c) => { const postFile = files.find(f => f === fileName); if (!postFile) { c.status(404); - return c.render(); + const meta: SiteMeta = { + description: "Page does not exist." + }; + return c.render(, { meta }); } const post = await readPostMarkdown(__dirname + "/../../posts/" + postFile); - const meta = { + const meta: SiteMeta = { description: post.meta.description, tags: post.meta.tags, author: "Dave Smith-Hayes"