From baea04747697ad5039139ef44bca7b3965147696 Mon Sep 17 00:00:00 2001 From: "quentin@aristote.fr" Date: Mon, 21 Aug 2023 17:50:43 +0200 Subject: update info api --- html/basics/default.nix | 18 +++++++++-------- html/default.nix | 7 ++++--- html/education/default.nix | 45 +++++++++++++++++++++---------------------- html/experience/default.nix | 38 +++++++++++++++++++----------------- html/languages/default.nix | 7 +++++-- html/publications/default.nix | 3 ++- html/software/default.nix | 3 +-- 7 files changed, 64 insertions(+), 57 deletions(-) (limited to 'html') diff --git a/html/basics/default.nix b/html/basics/default.nix index 7ee8be4..55de692 100644 --- a/html/basics/default.nix +++ b/html/basics/default.nix @@ -1,7 +1,9 @@ { html, data, lib, ... }: let - basics = data.basics; + basics = data.basics // { + fullname = with data.basics.name; "${first} ${last}"; + }; col = html.div { class = "col"; style = "align-self: center"; @@ -13,8 +15,7 @@ in { title = "About me"; priority = 0; body = with html; - with data.basics; - lines [ + with basics; [ br (div { class = "row"; } [ (col [ @@ -27,7 +28,7 @@ in { "512" ] ++ [ "${avatar} 934w" ]); sizes = "(max-width: 480px) 60vw, 30vw"; - alt = "Quentin Aristote"; + alt = fullname; style = '' aspect-ratio: 1 / 1; border-radius: 50%; @@ -35,13 +36,14 @@ in { display: block; ''; }) - (center h3 name) - (center p (with institution; [ position br "@ ${href url name}" ])) + (center h3 fullname) + (center p (with institution; [ position wbr "@ ${href url name}" ])) ]) (col (dl [ (dt "${icon "las la-at"} e-mail") - (dd (for email - (email: "${mailto email.address} (${email.name}) ${br}"))) + (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") diff --git a/html/default.nix b/html/default.nix index 61e7a96..0d4f19a 100644 --- a/html/default.nix +++ b/html/default.nix @@ -1,4 +1,4 @@ -{ html, make, ... }: +{ html, make, data, ... }: let sections = html.sort.byKey "priority" (make ./sections.nix { }); @@ -8,15 +8,16 @@ let 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 "Quentin Aristote") + (title fullname) (metaWith { name = "description"; - content = "Personal webpage of Quentin Aristote"; + content = "Personal webpage of ${fullname}"; }) (metaWith { name = "author"; 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 ]) ])); diff --git a/html/experience/default.nix b/html/experience/default.nix index b89396b..abe1109 100644 --- a/html/experience/default.nix +++ b/html/experience/default.nix @@ -5,22 +5,24 @@ in { title = "Experience"; priority = 20; body = with html; - dl (for (sort.reverse.byPath [ "date" "start" ] experience) (item: - with item; - lines [ - (dt [ - (with institution; "${position} @ ${href url name}, ${location}") - br - (small (lib.concatStringsSep " · " - ([ (with date; timerange start end) ] - ++ lib.optional (lib.hasAttr "supervisors" item) - "supervised by ${ - lib.concatStringsSep " " - (for supervisors (supervisor: with supervisor; href url name)) - }" ++ lib.optional (lib.hasAttr "assets" item) - (lib.concatStringsSep " " (for assets - (asset: with asset; href "#${type}#${id}" "${icon "las la-paperclip"} ${name}")))))) - ]) - (dd description) - ])); + dl (for + (sort.reverse.byFun (item: with item.date.start; day + 100 * month + 10000 * year) + experience) (item: + with item; [ + (dt [ + (with institution; "${position} @ ${href url name}, ${location}") + br + (small (lib.concatStringsSep " · " + ([ (with date; timerange start end) ] + ++ lib.optional (item ? supervisors) "supervised by ${ + lib.concatStringsSep " " (for supervisors + (supervisor: with supervisor; href url name)) + }" ++ lib.optional (item ? assets) (lib.concatStringsSep " " + (for assets (asset: + with asset; + href "#${type}#${id}" + "${icon "las la-paperclip"} ${name}")))))) + ]) + (dd description) + ])); } diff --git a/html/languages/default.nix b/html/languages/default.nix index 36780db..f7c49f0 100644 --- a/html/languages/default.nix +++ b/html/languages/default.nix @@ -5,6 +5,9 @@ in { title = "Languages"; priority = 40; body = with html; - lines (for languages - (language: with language; "${icon} ${name} (${proficiency})")); + (for languages (language: + with language; + "${ + lib.concatStrings (for icon.codepoints (codepoint: "&x${codepoint}")) + } ${name} (${proficiency})")); } diff --git a/html/publications/default.nix b/html/publications/default.nix index 1a2688b..289f9e3 100644 --- a/html/publications/default.nix +++ b/html/publications/default.nix @@ -15,7 +15,8 @@ let { inherit id title url year abstract cite; } // (let - authorsOther = lib.remove data.basics.name + authorsOther = + lib.remove "${data.basics.name.first} ${data.basics.name.last}" (builtins.map (author: "${author.given} ${author.family}") author); in lib.optionalAttrs (authorsOther != [ ]) { authors = "With ${lib.concatStringsSep ", " authorsOther}"; diff --git a/html/software/default.nix b/html/software/default.nix index d0ed803..49f4627 100644 --- a/html/software/default.nix +++ b/html/software/default.nix @@ -20,8 +20,7 @@ in { body = with html; dl (for (sort.byPath [ "title" ] software) (softwarePiece: let formatted = format softwarePiece; - in with formatted; - lines [ + in with formatted; [ (dt { id = "Software#${id}"; } (href { target = "_blank"; } url title)) (dd abstract) ])); -- cgit v1.2.3