summaryrefslogtreecommitdiffhomepage
path: root/vhosts/blog/nuldoc-src/pages/home.tsx
blob: a9a5d5423b12a4b3b21fbbcbaf33fcf01ccda62f (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
import GlobalFooter from "../components/GlobalFooter.tsx";
import { renderToDOM } from "../jsx/render.ts";
import GlobalHeader from "../components/GlobalHeader.tsx";
import PageLayout from "../components/PageLayout.tsx";
import { Config } from "../config.ts";
import { Page } from "../page.ts";

export type HomePage = Page;

export async function generateHomePage(config: Config): Promise<HomePage> {
  const html = await renderToDOM(
    <PageLayout
      metaCopyrightYear={config.blog.siteCopyrightYear}
      metaDescription="nsfisis のブログサイト"
      metaTitle={config.blog.siteName}
      metaAtomFeedHref={`https://${config.blog.fqdn}/atom.xml`}
      config={config}
    >
      <body className="single">
        <GlobalHeader config={config} />
        <main className="main">
          <article className="post-single">
            <article className="post-entry">
              <a href="/about/">
                <header className="entry-header">
                  <h2>About</h2>
                </header>
              </a>
            </article>
            <article className="post-entry">
              <a href="/posts/">
                <header className="entry-header">
                  <h2>Posts</h2>
                </header>
              </a>
            </article>
            <article className="post-entry">
              <a href="/slides/">
                <header className="entry-header">
                  <h2>Slides</h2>
                </header>
              </a>
            </article>
            <article className="post-entry">
              <a href="/tags/">
                <header className="entry-header">
                  <h2>Tags</h2>
                </header>
              </a>
            </article>
          </article>
        </main>
        <GlobalFooter config={config} />
      </body>
    </PageLayout>,
  );

  return {
    root: html,
    renderer: "html",
    destFilePath: "/index.html",
    href: "/",
  };
}