From 3966620ceb8199f77dee89b003760328625a3d57 Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sun, 26 Feb 2023 19:02:29 +0100 Subject: publications: handle case with publisher but no details --- html/publications/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'html/publications/default.nix') 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 [ -- cgit v1.2.3