aboutsummaryrefslogtreecommitdiffhomepage
path: root/nuldoc-src/pages/not_found.ts
diff options
context:
space:
mode:
Diffstat (limited to 'nuldoc-src/pages/not_found.ts')
-rw-r--r--nuldoc-src/pages/not_found.ts51
1 files changed, 51 insertions, 0 deletions
diff --git a/nuldoc-src/pages/not_found.ts b/nuldoc-src/pages/not_found.ts
new file mode 100644
index 0000000..65938dd
--- /dev/null
+++ b/nuldoc-src/pages/not_found.ts
@@ -0,0 +1,51 @@
+import { globalFooter } from "../components/global_footer.ts";
+import { globalHeader } from "../components/global_header.ts";
+import { pageLayout } from "../components/page_layout.ts";
+import { Config } from "../config.ts";
+import { el, text } from "../dom.ts";
+import { Page } from "../page.ts";
+
+export type NotFoundPage = Page;
+
+export async function generateNotFoundPage(
+ config: Config,
+): Promise<NotFoundPage> {
+ const body = el(
+ "body",
+ [["class", "single"]],
+ globalHeader(config),
+ el(
+ "main",
+ [["class", "main"]],
+ el(
+ "article",
+ [],
+ el(
+ "div",
+ [["class", "not-found"]],
+ text("404"),
+ ),
+ ),
+ ),
+ globalFooter(config),
+ );
+
+ const html = await pageLayout(
+ {
+ metaCopyrightYear: config.blog.siteCopyrightYear,
+ metaDescription: "リクエストされたページが見つかりません。",
+ metaKeywords: [],
+ metaTitle: "Page Not Found",
+ requiresSyntaxHighlight: false,
+ },
+ body,
+ config,
+ );
+
+ return {
+ root: el("__root__", [], html),
+ renderer: "html",
+ destFilePath: "/404.html",
+ href: "/404.html",
+ };
+}