summaryrefslogtreecommitdiff
path: root/html/default.nix
blob: 2b398c1c0dd142511a3e1220ad366252597d2a0a (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
{
  html,
  make,
  data,
  ...
}: let
  sections = html.sort.byKey "priority" (make ./sections.nix {});
  preloadFont = href:
    html.linkWith {
      inherit href;
      rel = "preload";
      as = "font";
    };
  fullname = with data.basics.name; "${first} ${last}";
in
  with html;
    doctype "html"
    + html.html {lang = "en";} [
      (head [
        # Basic page needs
        (metaWith {charset = "utf-8";})
        (title fullname)
        (metaWith {
          name = "description";
          content = "Personal webpage of ${fullname}";
        })
        (metaWith {
          name = "author";
          content = "Quentin Aristote";
        })
        (metaWith {
          http-equiv = "x-ua-compatible";
          content = "ie=edge";
        })
        # Mobile specific needs
        (metaWith {
          name = "viewport";
          content = "width=device-width, initial-scale=1";
        })
        # Font
        (linkWith {
          rel = "stylesheet";
          href = "/static/css/fonts/line-awesome/line-awesome.min.css";
        })
        (preloadFont "/static/css/fonts/line-awesome/webfonts/la-solid-900.woff2")
        (preloadFont "/static/css/fonts/line-awesome/webfonts/la-brands-400.woff2")
        # CSS
        (linkWith {
          rel = "stylesheet";
          href = "/static/css/classless.min.css";
        })
        # Favicon
        (linkWith {
          rel = "icon";
          type = "image/png";
          href = "/static/icon.png";
        })
      ])
      (body [
        (main {role = "main";} (for sections (section: section.body)))
        (footer "Webpage ${
            href "#Software#aristoteWebpage" "generated"
          } with the help of ${href "https://nixos.org/" "Nix"} and ${
            href "https://classless.de/" "Classless CSS"
          }, and compressed with the help of ${
            href "https://https://go.tacodewolff.nl/minify" "minify"
          }, ${
            href "https://github.com/uncss/uncss" "uncss"
          }, ${href "https://yui.github.io/yuicompressor/" "YUI Compressor"} and ${
            href "https://imagemagick.org/" "ImageMagick"
          }.")
      ])
    ]