summaryrefslogtreecommitdiff
path: root/html/basics/default.nix
blob: 990905387f5ba0fcaf142e39ae535e5e321f9ac9 (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
{
  html,
  data,
  lib,
  ...
}:
let
  basics = data.basics // {
    fullname = with data.basics.name; "${first} ${last}";
  };
  col = html.div {
    class = "col";
    style = "align-self: center";
  };
  center = container: content: container { style = "text-align: center"; } content;
  icon-lab = name: html.icon "lab la-${name}";
in
{
  title = "About me";
  priority = 0;
  body =
    with html;
    with basics;
    [
      br
      (div { class = "row"; } [
        (col [
          (imgWith {
            src = avatar;
            srcset = lib.concatStringsSep ", " (
              builtins.map (size: "${avatar}.${size} ${size}w") [
                "128"
                "256"
                "512"
              ]
              ++ [ "${avatar} 934w" ]
            );
            sizes = "(max-width: 480px) 60vw, 30vw";
            alt = fullname;
            style = ''
              aspect-ratio: 1 / 1;
              border-radius: 50%;
              margin: auto;
              display: block;
            '';
          })
          (center h3 fullname)
          (center p (
            with institution;
            [
              field
              br
              position
              "@ ${href url name}"
            ]
          ))
        ])
        (col (dl [
          (dt "${icon "las la-at"} e-mail")
          (dd (lib.mapAttrsToList (name: value: "${mailto value} (${name}) ${br}") email))
          (dt "${icon "las la-key"} keys")
          (dd (for keys.pgp (name: path: href path name)))
          (dt "${icon "las la-map-marker"} address")
          (dd (
            with location;
            ''
              Office ${office}${br}
              ${number} ${street}${br}
              ${postalCode} ${city}
            ''
          ))
          (dt "${icon "las la-globe"} online")
          (dd (
            for profiles (
              name: value:
              with value;
              "${icon-lab icon} ${
                if value ? url then
                  href url name
                else
                  "${name}: ${
                    lines (for profiles (name: value: with value; "${icon-lab icon} ${href url name}"))
                  } ${br}"
              }"
            )
          ))
          (dt "")
        ]))
      ])
      (p { style = "text-align: justify"; } description)
    ];
}