diff options
Diffstat (limited to 'html/education/default.nix')
| -rw-r--r-- | html/education/default.nix | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/html/education/default.nix b/html/education/default.nix index e1027e3..56f0915 100644 --- a/html/education/default.nix +++ b/html/education/default.nix @@ -1,38 +1,37 @@ { html, data, lib, ... }: -let education = data.education; +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 (sort.reverse.byPath [ "date" "start" ] education) (item: - with item; - lines [ + 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 (lib.hasAttr "years" item) (lines - (for (sort.reverse.byPath [ "date" "start" ] years) (year: - with year; - details [ - (summary [ - (with program; - "${studyType} @ ${ - href url (abbr { title = name; } acronym) - }") - br - (with date; small (timerange start end)) - ]) - description - (lines (for courses (category: list: - details [ - (summary "${category} courses") - (lib.concatStringsSep " · " (lib.naturalSort list)) - ]))) - ])))) + (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 ]) ])); |
