summaryrefslogtreecommitdiff
path: root/html/research/talks.nix
diff options
context:
space:
mode:
authoraristote <quentin.aristote@irif.fr>2025-07-27 17:47:32 +0200
committeraristote <quentin.aristote@irif.fr>2025-07-27 17:47:32 +0200
commit8622e40e675c72b9402625189517f99891a046c9 (patch)
treee1384995b609e7154f38725a29183f2f442d2c75 /html/research/talks.nix
parent90b687b24ca7f64bd4087144a40c6a2f6e3c14a9 (diff)
add talks to publications, rename to research, split into tabbox
Diffstat (limited to 'html/research/talks.nix')
-rw-r--r--html/research/talks.nix81
1 files changed, 81 insertions, 0 deletions
diff --git a/html/research/talks.nix b/html/research/talks.nix
new file mode 100644
index 0000000..9e1fd56
--- /dev/null
+++ b/html/research/talks.nix
@@ -0,0 +1,81 @@
+{
+ html,
+ data,
+ lib,
+ ...
+}: let
+ matchFirst = regexp: str: let
+ results = builtins.match regexp str;
+ in
+ if results == null
+ then null
+ else builtins.head results;
+ join = url: name: with html; lib.optionalString (url != null) " ยท ${href url "${icon "las la-paperclip"} ${name}"}";
+ talks = data.publications.talks;
+in
+ with html;
+ dl (for (sort.reverse.byPath ["issued" "date-parts"] talks) (item:
+ with item; let
+ date-parts = builtins.head issued.date-parts;
+ date = {
+ year = builtins.elemAt date-parts 0;
+ month = builtins.elemAt date-parts 1;
+ day = builtins.elemAt date-parts 2;
+ };
+ extra =
+ if item ? note
+ then note
+ else "";
+ abstractURL = matchFirst ".*abstract: ([^\n ]*).*" extra;
+ slidesURL = matchFirst ".*slides: ([^\n ]*).*" extra;
+ # broken because of tabs
+ # paperURL = let
+ # paperId = matchFirst "([A-z0-9]*[0-9]{4})[a-z]" id;
+ # in
+ # if paperId == null
+ # then null
+ # else "#Writings#${paperId}";
+ in [
+ (dt [
+ ((
+ if abstractURL == null
+ then (x: x)
+ else href abstractURL
+ ) (em title))
+ ])
+ (dd [
+ (with (makeDate date); tag pretty)
+ "@ ${href url event-title}, ${publisher-place}"
+ (join slidesURL "slides")
+ # broken because of tabs
+ # (join paperURL "paper")
+ (details [
+ (summary "More")
+ (
+ dl (
+ lib.optionals (item ? abstract) [
+ (dt "Abstract.")
+ (dd (blockquote abstract))
+ ]
+ ++ [
+ (dt "Cite.")
+ (let
+ citeWith = title: type:
+ details [
+ (summary title)
+ (pre (code (
+ lib.readFile "${data.publications.files}/${type}/${id}"
+ )))
+ ];
+ in
+ dd [
+ (citeWith "BibLaTeX" "biblatex")
+ (citeWith "BibTeX" "bibtex")
+ (citeWith "CSL JSON" "csljson")
+ ])
+ ]
+ )
+ )
+ ])
+ ])
+ ]))