diff options
| author | quentin@aristote.fr <quentin@aristote.fr> | 2023-09-30 21:25:03 +0200 |
|---|---|---|
| committer | quentin@aristote.fr <quentin@aristote.fr> | 2023-09-30 21:25:03 +0200 |
| commit | 1036c49e9e3c3ff311a713cccf0054c8c16a9857 (patch) | |
| tree | 8a9495eb0181cef35f690879267120bc3de3defe /html | |
| parent | add6bcd3c1984068e7122fa07a8f3e35ebaf58a9 (diff) | |
format
Diffstat (limited to 'html')
| -rw-r--r-- | html/basics/default.nix | 118 | ||||
| -rw-r--r-- | html/default.nix | 123 | ||||
| -rw-r--r-- | html/education/default.nix | 39 | ||||
| -rw-r--r-- | html/experience/default.nix | 41 | ||||
| -rw-r--r-- | html/languages/default.nix | 19 | ||||
| -rw-r--r-- | html/publications/default.nix | 113 | ||||
| -rw-r--r-- | html/sections.nix | 29 | ||||
| -rw-r--r-- | html/software/default.nix | 39 |
8 files changed, 281 insertions, 240 deletions
diff --git a/html/basics/default.nix b/html/basics/default.nix index 55de692..55517f4 100644 --- a/html/basics/default.nix +++ b/html/basics/default.nix @@ -1,72 +1,76 @@ -{ html, data, lib, ... }: - -let - basics = data.basics // { - fullname = with data.basics.name; "${first} ${last}"; - }; +{ + 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; + 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") [ + 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; [ position wbr "@ ${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}" - }"))) - ])) + ] + ++ ["${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; [position wbr "@ ${href url name}"])) ]) - description - ]; + (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}" + }"))) + ])) + ]) + description + ]; } diff --git a/html/default.nix b/html/default.nix index 0d4f19a..22686bc 100644 --- a/html/default.nix +++ b/html/default.nix @@ -1,7 +1,10 @@ -{ html, make, data, ... }: - -let - sections = html.sort.byKey "priority" (make ./sections.nix { }); +{ + html, + make, + data, + ... +}: let + sections = html.sort.byKey "priority" (make ./sections.nix {}); preloadFont = href: html.linkWith { inherit href; @@ -9,58 +12,60 @@ let 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 fullname) - (metaWith { - name = "description"; - content = "Personal webpage of ${fullname}"; - }) - (metaWith { - name = "author"; - content = "Quentin Aristote"; - }) - (metaWith { - http-equiv = "x-ua-compatible"; - content = "ie=edge"; - }) - # Mobile specific needs - (metaWith { - name = "viewport"; - content = "width=device-width, initial-scale=1"; - }) - # Font - (linkWith { - rel = "stylesheet"; - href = "/static/css/fonts/line-awesome/line-awesome.min.css"; - }) - (preloadFont "/static/css/fonts/line-awesome/webfonts/la-solid-900.woff2") - (preloadFont "/static/css/fonts/line-awesome/webfonts/la-brands-400.woff2") - # CSS - (linkWith { - rel = "stylesheet"; - href = "/static/css/classless.min.css"; - }) - # Favicon - (linkWith { - rel = "icon"; - type = "image/png"; - href = "/static/icon.png"; - }) - ]) - (body [ - (main { role = "main"; } (for sections (section: section.body))) - (footer "Webpage ${ - href "#Software#aristoteWebpage" "generated" - } with the help of ${href "https://nixos.org/" "Nix"} and ${ - href "https://classless.de/" "Classless CSS" - }, and compressed with the help of ${ - href "https://github.com/uncss/uncss" "uncss" - }, ${href "https://yui.github.io/yuicompressor/" "YUI Compressor"} and ${ - href "https://imagemagick.org/" "ImageMagick" - }.") - ]) -] +in + with html; + doctype "html" + + html.html {lang = "en";} [ + (head [ + # Basic page needs + (metaWith {charset = "utf-8";}) + (title fullname) + (metaWith { + name = "description"; + content = "Personal webpage of ${fullname}"; + }) + (metaWith { + name = "author"; + content = "Quentin Aristote"; + }) + (metaWith { + http-equiv = "x-ua-compatible"; + content = "ie=edge"; + }) + # Mobile specific needs + (metaWith { + name = "viewport"; + content = "width=device-width, initial-scale=1"; + }) + # Font + (linkWith { + rel = "stylesheet"; + href = "/static/css/fonts/line-awesome/line-awesome.min.css"; + }) + (preloadFont "/static/css/fonts/line-awesome/webfonts/la-solid-900.woff2") + (preloadFont "/static/css/fonts/line-awesome/webfonts/la-brands-400.woff2") + # CSS + (linkWith { + rel = "stylesheet"; + href = "/static/css/classless.min.css"; + }) + # Favicon + (linkWith { + rel = "icon"; + type = "image/png"; + href = "/static/icon.png"; + }) + ]) + (body [ + (main {role = "main";} (for sections (section: section.body))) + (footer "Webpage ${ + href "#Software#aristoteWebpage" "generated" + } with the help of ${href "https://nixos.org/" "Nix"} and ${ + href "https://classless.de/" "Classless CSS" + }, and compressed with the help of ${ + href "https://github.com/uncss/uncss" "uncss" + }, ${href "https://yui.github.io/yuicompressor/" "YUI Compressor"} and ${ + href "https://imagemagick.org/" "ImageMagick" + }.") + ]) + ] diff --git a/html/education/default.nix b/html/education/default.nix index 56f0915..0dcc977 100644 --- a/html/education/default.nix +++ b/html/education/default.nix @@ -1,8 +1,12 @@ -{ html, data, lib, ... }: - -let +{ + html, + data, + lib, + ... +}: let education = data.education; - sortByDateStart = html.sort.reverse.byFun + sortByDateStart = + html.sort.reverse.byFun (item: with item.date.start; day + 100 * month + 10000 * year); in { title = "Education"; @@ -18,20 +22,19 @@ in { (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)) - ])) - ]))) + 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 abe1109..b7f258b 100644 --- a/html/experience/default.nix +++ b/html/experience/default.nix @@ -1,6 +1,10 @@ -{ html, data, lib, ... }: - -let experience = data.experience; +{ + html, + data, + lib, + ... +}: let + experience = data.experience; in { title = "Experience"; priority = 20; @@ -8,21 +12,22 @@ in { 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; + 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) - ])); + ]) + (dd description) + ])); } diff --git a/html/languages/default.nix b/html/languages/default.nix index f7c49f0..06df694 100644 --- a/html/languages/default.nix +++ b/html/languages/default.nix @@ -1,13 +1,14 @@ -{ html, data, ... }: - -let languages = data.languages; +{ + html, + data, + ... +}: let + languages = data.languages; in { title = "Languages"; priority = 40; - body = with html; - (for languages (language: - with language; - "${ - lib.concatStrings (for icon.codepoints (codepoint: "&x${codepoint}")) - } ${name} (${proficiency})")); + body = with html; (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 289f9e3..800d3aa 100644 --- a/html/publications/default.nix +++ b/html/publications/default.nix @@ -1,6 +1,9 @@ -{ html, data, lib, ... }: - -let +{ + html, + data, + lib, + ... +}: let publications = data.publications; attrValsOpt = attrs: attrSet: lib.attrVals (builtins.filter (attr: lib.hasAttr attr attrSet) attrs) @@ -12,58 +15,68 @@ let format = publication: with html; with publication; - { - inherit id title url year abstract cite; - } // (let - 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}"; - }) // lib.optionalAttrs (publication ? container-title) { - published = "In ${em container-title}" + concatStringsPrefix ", " - (attrValsOpt [ "volume" "issue" "publisher" ] publication); - } // lib.optionalAttrs (publication ? ISBN) { - isbn = "${small "ISBN"}: ${ISBN}"; - } // lib.optionalAttrs (publication ? ISSN) { - issn = "${small "ISSN"}: ${ISSN}"; - } // lib.optionalAttrs (publication ? DOI) { - doi = "${small "DOI"}: ${href "https://doi.org/${DOI}" (code DOI)}"; - }; + { + inherit id title url year abstract cite; + } + // (let + 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}"; + }) + // lib.optionalAttrs (publication ? container-title) { + published = + "In ${em container-title}" + + concatStringsPrefix ", " + (attrValsOpt ["volume" "issue" "publisher"] publication); + } + // lib.optionalAttrs (publication ? ISBN) { + isbn = "${small "ISBN"}: ${ISBN}"; + } + // lib.optionalAttrs (publication ? ISSN) { + issn = "${small "ISSN"}: ${ISSN}"; + } + // lib.optionalAttrs (publication ? DOI) { + doi = "${small "DOI"}: ${href "https://doi.org/${DOI}" (code DOI)}"; + }; in { title = "Publications"; priority = 10; body = with html; - dl (for (sort.reverse.byPath [ "issued" "date-parts" ] publications) - (publication: - let formatted = format publication; - in with formatted; - lines [ - (dt { id = "Publications#${id}"; } - "${href { target = "_blank"; } url title} (${year})") - (dd [ - (concatStringsSuffix ". " - (attrValsOpt [ "authors" "published" "isbn" "issn" "doi" ] - formatted)) - (details [ - (summary "More") - (dl [ - (dt "Abstract.") - (dd (blockquote abstract)) - (dt "Cite.") - (let - citeWith = title: attr: - details [ - (summary title) - (pre (code (lib.getAttr attr cite))) - ]; - in dd [ - (citeWith "BibLaTeX" "biblatex") - (citeWith "BibTeX" "bibtex") - (citeWith "CSL JSON" "csljson") + dl (for (sort.reverse.byPath ["issued" "date-parts"] publications) + (publication: let + formatted = format publication; + in + with formatted; + lines [ + (dt {id = "Publications#${id}";} + "${href {target = "_blank";} url title} (${year})") + (dd [ + (concatStringsSuffix ". " + (attrValsOpt ["authors" "published" "isbn" "issn" "doi"] + formatted)) + (details [ + (summary "More") + (dl [ + (dt "Abstract.") + (dd (blockquote abstract)) + (dt "Cite.") + (let + citeWith = title: attr: + details [ + (summary title) + (pre (code (lib.getAttr attr cite))) + ]; + in + dd [ + (citeWith "BibLaTeX" "biblatex") + (citeWith "BibTeX" "bibtex") + (citeWith "CSL JSON" "csljson") + ]) ]) ]) ]) - ]) - ])); + ])); } diff --git a/html/sections.nix b/html/sections.nix index 4c4f0b0..3c4065f 100644 --- a/html/sections.nix +++ b/html/sections.nix @@ -1,19 +1,22 @@ -{ html, make, ... }: - -let +{ + html, + make, + ... +}: let sectionTemplate = section: { inherit (section) title priority; - body = html.section { id = section.title; } [ + body = html.section {id = section.title;} [ (html.h1 section.title) section.body ]; }; - makeSection = path: sectionTemplate (make path { }); -in builtins.map makeSection [ - ./basics - ./education - ./experience - # ./languages - ./publications - ./software -] + makeSection = path: sectionTemplate (make path {}); +in + builtins.map makeSection [ + ./basics + ./education + ./experience + # ./languages + ./publications + ./software + ] diff --git a/html/software/default.nix b/html/software/default.nix index 49f4627..9d42345 100644 --- a/html/software/default.nix +++ b/html/software/default.nix @@ -1,27 +1,34 @@ -{ html, data, lib, ... }: - -let +{ + 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}"; - }); + { + 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)) + 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) ])); } |
