summaryrefslogtreecommitdiff
path: root/html
diff options
context:
space:
mode:
authorQuentin Aristote <quentin@aristote.fr>2022-11-12 11:41:51 +0100
committerQuentin Aristote <quentin@aristote.fr>2022-11-12 11:41:51 +0100
commitdbf48a4665a66dd37150f3886026ecd9bd82967f (patch)
tree65bc5167f7c71952cf2ce4072197f6e23e81f98b /html
parent056ee77ab2ed3cf488ac9b1b8ac82664948a42a3 (diff)
restructure directories
Diffstat (limited to 'html')
-rw-r--r--html/basics/default.nix26
-rw-r--r--html/default.nix52
-rw-r--r--html/education/default.nix39
-rw-r--r--html/experience/default.nix26
-rw-r--r--html/languages/default.nix10
-rw-r--r--html/publications/default.nix64
-rw-r--r--html/sections.nix18
7 files changed, 235 insertions, 0 deletions
diff --git a/html/basics/default.nix b/html/basics/default.nix
new file mode 100644
index 0000000..d7f7a90
--- /dev/null
+++ b/html/basics/default.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/html/default.nix b/html/default.nix
new file mode 100644
index 0000000..96ac341
--- /dev/null
+++ b/html/default.nix
@@ -0,0 +1,52 @@
+{ html, make, ... }:
+
+let sections = html.sort.byKey "priority" (make ./sections.nix { });
+in with html;
+html.html { lang = "en"; } [
+ (head [
+ # Basic page needs
+ (metaWith { charset = "utf-8"; })
+ (title "Quentin Aristote")
+ (metaWith {
+ name = "description";
+ content = "Personal webpage of Quentin Aristote";
+ })
+ (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";
+ })
+ # CSS
+ (linkWith {
+ rel = "stylesheet";
+ href = "https://classless.de/classless.css";
+ })
+ # Favicon
+ (linkWith {
+ rel = "icon";
+ type = "image/png";
+ href = "static/icon.png";
+ })
+ ])
+ (body [
+ (header [
+ (nav (ul ([ (li "Quentin Aristote") ] ++ for sections
+ (section: li (href "#${section.title}" section.title)))))
+ ])
+ (main { role = "main"; } (for sections (section: section.body)))
+ (footer [ ])
+ ])
+]
diff --git a/html/education/default.nix b/html/education/default.nix
new file mode 100644
index 0000000..e1027e3
--- /dev/null
+++ b/html/education/default.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/html/experience/default.nix b/html/experience/default.nix
new file mode 100644
index 0000000..8637802
--- /dev/null
+++ b/html/experience/default.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/html/languages/default.nix b/html/languages/default.nix
new file mode 100644
index 0000000..36780db
--- /dev/null
+++ b/html/languages/default.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/html/publications/default.nix b/html/publications/default.nix
new file mode 100644
index 0000000..04bb502
--- /dev/null
+++ b/html/publications/default.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")
+ ])
+ ])
+ ])
+ ])
+ ]));
+}
diff --git a/html/sections.nix b/html/sections.nix
new file mode 100644
index 0000000..2a571b6
--- /dev/null
+++ b/html/sections.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
+ ./education
+ ./experience
+ # ./languages
+ ./publications
+]