Add 404 and 500 page #446 (#624)

* Add 404 and 500 page

Co-authored-by: hashrock <hashrock@users.noreply.github.com>
This commit is contained in:
Michael Pfister
2022-08-16 23:52:06 +09:00
committed by GitHub
co-authored by hashrock
parent 55f657827f
commit 3431555f95
5 changed files with 70 additions and 24 deletions
+1 -3
View File
@@ -34,9 +34,7 @@ export const handler: Handlers<Data> = {
}
const entry = TABLE_OF_CONTENTS[slug];
if (!entry) {
return new Response("404 Page not found", {
status: 404,
});
return ctx.renderNotFound();
}
const url = new URL(`../../../${entry.file}`, import.meta.url);
const fileContent = await Deno.readTextFile(url);