diff options
Diffstat (limited to 'nuldoc-src/pages')
| -rw-r--r-- | nuldoc-src/pages/about.ts | 2 | ||||
| -rw-r--r-- | nuldoc-src/pages/home.ts | 96 | ||||
| -rw-r--r-- | nuldoc-src/pages/not_found.ts | 2 | ||||
| -rw-r--r-- | nuldoc-src/pages/post.ts | 2 | ||||
| -rw-r--r-- | nuldoc-src/pages/post_list.ts | 2 | ||||
| -rw-r--r-- | nuldoc-src/pages/tag.ts | 2 | ||||
| -rw-r--r-- | nuldoc-src/pages/tag_list.ts | 2 |
7 files changed, 102 insertions, 6 deletions
diff --git a/nuldoc-src/pages/about.ts b/nuldoc-src/pages/about.ts index 4f98930..ab60c2b 100644 --- a/nuldoc-src/pages/about.ts +++ b/nuldoc-src/pages/about.ts @@ -42,7 +42,7 @@ export async function generateAboutPage(config: Config): Promise<AboutPage> { metaCopyrightYear: config.blog.siteCopyrightYear, metaDescription: "このサイトの著者について", metaKeywords: [], - metaTitle: "About", + metaTitle: `About | ${config.blog.siteName}`, requiresSyntaxHighlight: false, }, body, diff --git a/nuldoc-src/pages/home.ts b/nuldoc-src/pages/home.ts new file mode 100644 index 0000000..a240278 --- /dev/null +++ b/nuldoc-src/pages/home.ts @@ -0,0 +1,96 @@ +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 HomePage = Page; + +export async function generateHomePage(config: Config): Promise<HomePage> { + const body = el( + "body", + [["class", "single"]], + globalHeader(config), + el( + "main", + [["class", "main"]], + el( + "article", + [["class", "post-single"]], + el( + "article", + [["class", "post-entry"]], + el( + "a", + [["href", "/about/"]], + el( + "header", + [["class", "entry-header"]], + el("h2", [], text("About")), + ), + ), + ), + el( + "article", + [["class", "post-entry"]], + el( + "a", + [["href", "/posts/"]], + el( + "header", + [["class", "entry-header"]], + el("h2", [], text("Posts")), + ), + ), + ), + el( + "article", + [["class", "post-entry"]], + el( + "a", + [["href", "/slides/"]], + el( + "header", + [["class", "entry-header"]], + el("h2", [], text("Slides")), + ), + ), + ), + el( + "article", + [["class", "post-entry"]], + el( + "a", + [["href", "/tags/"]], + el( + "header", + [["class", "entry-header"]], + el("h2", [], text("Tags")), + ), + ), + ), + ), + ), + globalFooter(config), + ); + + const html = await pageLayout( + { + metaCopyrightYear: config.blog.siteCopyrightYear, + metaDescription: "nsfisis のブログサイト", + metaKeywords: [], + metaTitle: config.blog.siteName, + requiresSyntaxHighlight: false, + }, + body, + config, + ); + + return { + root: el("__root__", [], html), + renderer: "html", + destFilePath: "/index.html", + href: "/", + }; +} diff --git a/nuldoc-src/pages/not_found.ts b/nuldoc-src/pages/not_found.ts index 65938dd..a1b6109 100644 --- a/nuldoc-src/pages/not_found.ts +++ b/nuldoc-src/pages/not_found.ts @@ -35,7 +35,7 @@ export async function generateNotFoundPage( metaCopyrightYear: config.blog.siteCopyrightYear, metaDescription: "リクエストされたページが見つかりません。", metaKeywords: [], - metaTitle: "Page Not Found", + metaTitle: `Page Not Found | ${config.blog.siteName}`, requiresSyntaxHighlight: false, }, body, diff --git a/nuldoc-src/pages/post.ts b/nuldoc-src/pages/post.ts index 597a667..0bc313b 100644 --- a/nuldoc-src/pages/post.ts +++ b/nuldoc-src/pages/post.ts @@ -120,7 +120,7 @@ export async function generatePostPage( metaKeywords: doc.tags.map((slug) => (config.blog.tagLabels as { [key: string]: string })[slug] ), - metaTitle: doc.title, + metaTitle: `${doc.title} | ${config.blog.siteName}`, requiresSyntaxHighlight: true, }, body, diff --git a/nuldoc-src/pages/post_list.ts b/nuldoc-src/pages/post_list.ts index 5b511b0..ce26645 100644 --- a/nuldoc-src/pages/post_list.ts +++ b/nuldoc-src/pages/post_list.ts @@ -84,7 +84,7 @@ export async function generatePostListPage( metaCopyrightYear: config.blog.siteCopyrightYear, metaDescription: "投稿した記事の一覧", metaKeywords: [], - metaTitle: pageTitle, + metaTitle: `${pageTitle} | ${config.blog.siteName}`, requiresSyntaxHighlight: false, }, body, diff --git a/nuldoc-src/pages/tag.ts b/nuldoc-src/pages/tag.ts index a7ffbb2..c0b6262 100644 --- a/nuldoc-src/pages/tag.ts +++ b/nuldoc-src/pages/tag.ts @@ -78,7 +78,7 @@ export async function generateTagPage( ), metaDescription: `タグ「${tagLabel}」のついた記事一覧`, metaKeywords: [tagLabel], - metaTitle: pageTitle, + metaTitle: `${pageTitle} | ${config.blog.siteName}`, requiresSyntaxHighlight: false, }, body, diff --git a/nuldoc-src/pages/tag_list.ts b/nuldoc-src/pages/tag_list.ts index e4e53f0..bb481f8 100644 --- a/nuldoc-src/pages/tag_list.ts +++ b/nuldoc-src/pages/tag_list.ts @@ -60,7 +60,7 @@ export async function generateTagListPage( metaCopyrightYear: config.blog.siteCopyrightYear, metaDescription: "タグの一覧", metaKeywords: [], - metaTitle: pageTitle, + metaTitle: `${pageTitle} | ${config.blog.siteName}`, requiresSyntaxHighlight: false, }, body, |
