aboutsummaryrefslogtreecommitdiffhomepage
path: root/nuldoc-src/pages/about.ts
blob: bba4031a05c2d1519fe7e3386480d781986b7986 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import { Config } from "../config.ts";
import { Page } from "../page.ts";
import {
  el,
  linkElement,
  metaElement,
  stylesheetLinkElement,
  text,
} from "./utils.ts";

export type AboutPage = Page;

export async function generateAboutPage(config: Config): Promise<AboutPage> {
  const head = el(
    "head",
    [],
    metaElement([["charset", "UTF-8"]]),
    metaElement([["name", "viewport"], [
      "content",
      "width=device-width, initial-scale=1.0",
    ]]),
    metaElement([["name", "author"], ["content", config.blog.author]]),
    metaElement([["name", "copyright"], [
      "content",
      `&copy; ${config.blog.siteCopyrightYear} ${config.blog.author}`,
    ]]),
    metaElement([["name", "description"], [
      "content",
      "このサイトの著者について",
    ]]),
    linkElement("icon", "/favicon.svg", "image/svg+xml"),
    el("title", [], text(`About | ${config.blog.siteName}`)),
    await stylesheetLinkElement("/style.css", config),
  );
  const body = el(
    "body",
    [["class", "single"]],
    el(
      "header",
      [["class", "header"]],
      el(
        "nav",
        [["class", "nav"]],
        el(
          "ul",
          [],
          el(
            "li",
            [["class", "logo"]],
            el("a", [["href", "/"]], text(config.blog.siteName)),
          ),
          el(
            "li",
            [],
            el("a", [["href", "/about"]], text("About")),
          ),
          el(
            "li",
            [],
            el("a", [["href", "/posts"]], text("Posts")),
          ),
          el(
            "li",
            [],
            el("a", [["href", "/slides"]], text("Slides")),
          ),
        ),
      ),
    ),
    el(
      "main",
      [["class", "main"]],
      el(
        "article",
        [["class", "post-single"]],
        el(
          "header",
          [["class", "post-header"]],
          el(
            "h1",
            [["class", "post-title"]],
            text("About"),
          ),
        ),
        el(
          "div",
          [["class", "post-content"]],
          text("WIP"),
        ),
      ),
    ),
    el(
      "footer",
      [["class", "footer"]],
      text(
        `&copy; ${config.blog.siteCopyrightYear} ${config.blog.author}`,
      ),
    ),
  );
  const html = el(
    "html",
    [["lang", "ja-JP"]],
    head,
    body,
  );

  return {
    root: el("__root__", [], html),
    renderer: "html",
    destFilePath: "/about/index.html",
    href: "/about/",
  };
}