Add the site meta to the 404 page when looking for posts.
This commit is contained in:
parent
ac6dbb0fb4
commit
d49cf2cc98
@ -15,11 +15,14 @@ app.get('/:slug', async (c) => {
|
|||||||
const postFile = files.find(f => f === fileName);
|
const postFile = files.find(f => f === fileName);
|
||||||
if (!postFile) {
|
if (!postFile) {
|
||||||
c.status(404);
|
c.status(404);
|
||||||
return c.render(<FourOhFour />);
|
const meta: SiteMeta = {
|
||||||
|
description: "Page does not exist."
|
||||||
|
};
|
||||||
|
return c.render(<FourOhFour />, { meta });
|
||||||
}
|
}
|
||||||
|
|
||||||
const post = await readPostMarkdown(__dirname + "/../../posts/" + postFile);
|
const post = await readPostMarkdown(__dirname + "/../../posts/" + postFile);
|
||||||
const meta = {
|
const meta: SiteMeta = {
|
||||||
description: post.meta.description,
|
description: post.meta.description,
|
||||||
tags: post.meta.tags,
|
tags: post.meta.tags,
|
||||||
author: "Dave Smith-Hayes"
|
author: "Dave Smith-Hayes"
|
||||||
|
Loading…
Reference in New Issue
Block a user