summaryrefslogtreecommitdiff
path: root/html/publications/default.nix
diff options
context:
space:
mode:
authorquentin@aristote.fr <quentin@aristote.fr>2024-02-28 16:29:58 +0100
committerquentin@aristote.fr <quentin@aristote.fr>2024-02-28 16:29:58 +0100
commitc87fe21a93709ec707d9bb08341c78405f5522f4 (patch)
treee2fd11a94587d4e834a50d4416558617c81e97ef /html/publications/default.nix
parent4ce1eaafab7b567e4f5604215296470d9317a667 (diff)
publications: update and split selected
Diffstat (limited to 'html/publications/default.nix')
-rw-r--r--html/publications/default.nix84
1 files changed, 49 insertions, 35 deletions
diff --git a/html/publications/default.nix b/html/publications/default.nix
index 800d3aa..87dfb37 100644
--- a/html/publications/default.nix
+++ b/html/publications/default.nix
@@ -4,7 +4,6 @@
lib,
...
}: let
- publications = data.publications;
attrValsOpt = attrs: attrSet:
lib.attrVals (builtins.filter (attr: lib.hasAttr attr attrSet) attrs)
attrSet;
@@ -26,12 +25,18 @@
lib.optionalAttrs (authorsOther != []) {
authors = "With ${lib.concatStringsSep ", " authorsOther}";
})
+ // lib.optionalAttrs (publication ? note) {
+ note = publication.note;
+ }
// lib.optionalAttrs (publication ? container-title) {
published =
"In ${em container-title}"
+ concatStringsPrefix ", "
(attrValsOpt ["volume" "issue" "publisher"] publication);
}
+ // lib.optionalAttrs (publication ? event-title) {
+ published = "At ${em event-title}";
+ }
// lib.optionalAttrs (publication ? ISBN) {
isbn = "${small "ISBN"}: ${ISBN}";
}
@@ -41,42 +46,51 @@
// lib.optionalAttrs (publication ? DOI) {
doi = "${small "DOI"}: ${href "https://doi.org/${DOI}" (code DOI)}";
};
+ listPublications = collection: collectionTitle:
+ with html;
+ section {id = "Publications#${collectionTitle}";} [
+ (h2 collectionTitle)
+ (dl (for (sort.reverse.byPath ["issued" "date-parts"] collection)
+ (publication: let
+ formatted = format publication;
+ in
+ with formatted;
+ lines [
+ (dt {id = "Publications#${id}";}
+ "${href {target = "_blank";} url title} (${year})")
+ (dd [
+ (concatStringsSuffix ". "
+ (attrValsOpt ["authors" "note" "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")
+ ])
+ ])
+ ])
+ ])
+ ])))
+ ];
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")
- ])
- ])
- ])
- ])
- ]));
+ lines [
+ (listPublications data.publications.selected "Selected works")
+ (listPublications (with data.publications; lib.subtractLists selected all) "Other works")
+ ];
}