aboutsummaryrefslogtreecommitdiffhomepage
path: root/nuldoc-src/config.ts
blob: 5e1cad46d4b9ec7f3bda01ed3eea47ce6d864d74 (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
export const config = {
  locations: {
    contentDir: "/content",
    destDir: "/public",
    staticDir: "/static",
  },
  rendering: {
    html: {
      indentWidth: 2,
    },
  },
  blog: {
    author: "nsfisis",
    siteName: "REPL: Rest-Eat-Program Loop",
    siteCopyrightYear: 2021,
    tagLabels: {
      "conference": "カンファレンス",
      "cpp": "C++",
      "cpp17": "C++ 17",
      "note-to-self": "備忘録",
      "php": "PHP",
      "phpcon": "PHP カンファレンス",
      "phpconfuk": "PHP カンファレンス福岡",
      "phperkaigi": "PHPerKaigi",
      "phpstudy-tokyo": "PHP 勉強会@東京",
      "python": "Python",
      "python3": "Python 3",
      "ruby": "Ruby",
      "ruby3": "Ruby 3",
      "rust": "Rust",
      "vim": "Vim",
    },
  },
};

export type Config = typeof config;

export function getTagLabel(c: Config, slug: string): string {
  if (!(slug in c.blog.tagLabels)) {
    throw new Error(`Unknown tag: ${slug}`);
  }
  return (c.blog.tagLabels as { [slug: string]: string })[slug];
}