summaryrefslogtreecommitdiff
path: root/html/software/default.nix
blob: 9d42345c03d9dbccaa27d306f9f9048464f94bbc (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
{
  html,
  data,
  lib,
  ...
}: let
  software = data.software;
  format = softwarePiece:
    with html;
    with softwarePiece;
      {
        inherit id title abstract;
        url = URL;
      }
      // (let
        authorsOther =
          lib.remove data.basics.name
          (builtins.map (author: "${author.given} ${author.family}") author);
      in
        lib.optionalAttrs (authorsOther != []) {
          authors = "With ${lib.concatStringsSep ", " authorsOther}";
        });
in {
  title = "Software";
  priority = 15;
  body = with html;
    dl (for (sort.byPath ["title"] software) (softwarePiece: let
      formatted = format softwarePiece;
    in
      with formatted; [
        (dt {id = "Software#${id}";} (href {target = "_blank";} url title))
        (dd abstract)
      ]));
}