summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
authorQuentin Aristote <quentin@aristote.fr>2022-11-11 18:38:28 +0100
committerQuentin Aristote <quentin@aristote.fr>2022-11-11 18:38:28 +0100
commit056ee77ab2ed3cf488ac9b1b8ac82664948a42a3 (patch)
tree54c202aae529c00b86e413aee66bc77f332f2d17 /content
initial ocommit
Diffstat (limited to 'content')
-rw-r--r--content/basics.html.nix26
-rw-r--r--content/default.nix18
-rw-r--r--content/education.html.nix39
-rw-r--r--content/experience.html.nix26
-rw-r--r--content/languages.html.nix10
-rw-r--r--content/publications.html.nix64
6 files changed, 183 insertions, 0 deletions
diff --git a/content/basics.html.nix b/content/basics.html.nix
new file mode 100644
index 0000000..d7f7a90
--- /dev/null
+++ b/content/basics.html.nix
@@ -0,0 +1,26 @@
+{ html, data, ... }:
+
+let basics = data.basics;
+in {
+ title = "About me";
+ priority = 0;
+ body = with html;
+ with data.basics;
+ lines [
+ (div { class = "row"; } [
+ (div { class = "col"; } [ (imgWith { src = avatar; }) ])
+ (div { class = "col"; } (dl [
+ (dt "${icon "las la-at"} e-mail")
+ (dd (for email (email: "${mailto email.address} (${email.name}) ${br}")))
+ (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; ''
+ ${number} ${street}${br}
+ ${postalCode} ${city}
+ ''))
+ ]))
+ ])
+ description
+ ];
+}
diff --git a/content/default.nix b/content/default.nix
new file mode 100644
index 0000000..0b0d0ca
--- /dev/null
+++ b/content/default.nix
@@ -0,0 +1,18 @@
+{ html, make, ... }:
+
+let
+ sectionTemplate = section: {
+ inherit (section) title priority;
+ body = html.section { id = section.title; } [
+ (html.h1 section.title)
+ section.body
+ ];
+ };
+ makeSection = path: sectionTemplate (make path { });
+in builtins.map makeSection [
+ ./basics.html.nix
+ ./education.html.nix
+ ./experience.html.nix
+ # ./languages.html.nix
+ ./publications.html.nix
+]
diff --git a/content/education.html.nix b/content/education.html.nix
new file mode 100644
index 0000000..e1027e3
--- /dev/null
+++ b/content/education.html.nix
@@ -0,0 +1,39 @@
+{ html, data, lib, ... }:
+
+let education = data.education;
+in {
+ title = "Education";
+ priority = 30;
+ body = with html;
+ dl (for (sort.reverse.byPath [ "date" "start" ] education) (item:
+ with item;
+ lines [
+ (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))
+ ])))
+ ]))))
+ description
+ ])
+ ]));
+}
diff --git a/content/experience.html.nix b/content/experience.html.nix
new file mode 100644
index 0000000..8637802
--- /dev/null
+++ b/content/experience.html.nix
@@ -0,0 +1,26 @@
+{ html, data, lib, ... }:
+
+let experience = data.experience;
+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 "#Publications#${id}" "${icon "las la-paperclip"} ${name}"))))))
+ ])
+ (dd description)
+ ]));
+}
diff --git a/content/languages.html.nix b/content/languages.html.nix
new file mode 100644
index 0000000..36780db
--- /dev/null
+++ b/content/languages.html.nix
@@ -0,0 +1,10 @@
+{ html, data, ... }:
+
+let languages = data.languages;
+in {
+ title = "Languages";
+ priority = 40;
+ body = with html;
+ lines (for languages
+ (language: with language; "${icon} ${name} (${proficiency})"));
+}
diff --git a/content/publications.html.nix b/content/publications.html.nix
new file mode 100644
index 0000000..04bb502
--- /dev/null
+++ b/content/publications.html.nix
@@ -0,0 +1,64 @@
+{ html, data, lib, ... }:
+
+let
+ publications = data.publications;
+ attrValsOpt = attrs: attrSet:
+ lib.attrVals (builtins.filter (attr: lib.hasAttr attr attrSet) attrs)
+ attrSet;
+ format = publication:
+ with html;
+ with publication;
+ {
+ inherit id title url year abstract cite;
+ } // (let
+ authorsOther = lib.remove data.basics.name
+ (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}, " + lib.concatStringsSep ", "
+ (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 [
+ (lib.concatStringsSep ". "
+ (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")
+ ])
+ ])
+ ])
+ ])
+ ]));
+}