summaryrefslogtreecommitdiff
path: root/html
diff options
context:
space:
mode:
authorQuentin Aristote <quentin@aristote.fr>2023-02-26 19:02:29 +0100
committerQuentin Aristote <quentin@aristote.fr>2023-02-26 19:02:29 +0100
commit3966620ceb8199f77dee89b003760328625a3d57 (patch)
tree83a0b9531aeaa49f7fc9891b3bd55c389dc9d87e /html
parent1da2c88fa15b0eac9bac7b2685d6466a33845bdf (diff)
publications: handle case with publisher but no details
Diffstat (limited to 'html')
-rw-r--r--html/publications/default.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/html/publications/default.nix b/html/publications/default.nix
index 04bb502..1a2688b 100644
--- a/html/publications/default.nix
+++ b/html/publications/default.nix
@@ -5,6 +5,10 @@ let
attrValsOpt = attrs: attrSet:
lib.attrVals (builtins.filter (attr: lib.hasAttr attr attrSet) attrs)
attrSet;
+ concatStringsPrefix = prefix: strings:
+ lib.concatStrings (builtins.map (string: prefix + string) strings);
+ concatStringsSuffix = suffix: strings:
+ lib.concatStrings (builtins.map (string: string + suffix) strings);
format = publication:
with html;
with publication;
@@ -16,7 +20,7 @@ let
in lib.optionalAttrs (authorsOther != [ ]) {
authors = "With ${lib.concatStringsSep ", " authorsOther}";
}) // lib.optionalAttrs (publication ? container-title) {
- published = "In ${em container-title}, " + lib.concatStringsSep ", "
+ published = "In ${em container-title}" + concatStringsPrefix ", "
(attrValsOpt [ "volume" "issue" "publisher" ] publication);
} // lib.optionalAttrs (publication ? ISBN) {
isbn = "${small "ISBN"}: ${ISBN}";
@@ -37,7 +41,7 @@ in {
(dt { id = "Publications#${id}"; }
"${href { target = "_blank"; } url title} (${year})")
(dd [
- (lib.concatStringsSep ". "
+ (concatStringsSuffix ". "
(attrValsOpt [ "authors" "published" "isbn" "issn" "doi" ]
formatted))
(details [