summaryrefslogtreecommitdiff
path: root/html/education/default.nix
blob: 0dcc977264cb1a8dc1c4c3a2375c24eb659f0eb8 (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
{
  html,
  data,
  lib,
  ...
}: let
  education = data.education;
  sortByDateStart =
    html.sort.reverse.byFun
    (item: with item.date.start; day + 100 * month + 10000 * year);
in {
  title = "Education";
  priority = 30;
  body = with html;
    dl (for (sortByDateStart education) (item:
      with item; [
        (dt [
          (with institution; "${studyType} @ ${href url name}, ${location}")
          br
          (with date; small (timerange start end))
        ])
        (dd [
          (lib.optionalString (item ? years) (for (sortByDateStart years) (year:
            with year;
              details [
                (summary [
                  (with program; "${studyType} @ ${href url (abbr {title = name;} acronym)}")
                  br
                  (with date; small (timerange start end))
                ])
                description
                (for courses (category: list:
                  details [
                    (summary "${category} courses")
                    (lib.concatStringsSep " · " (lib.naturalSort list))
                  ]))
              ])))
          description
        ])
      ]));
}