From 519ea44ba07970773a0e9e34b26ac172f10e3601 Mon Sep 17 00:00:00 2001 From: Jan Heinrich Reimer Date: Mon, 17 Jun 2024 14:50:41 +0200 Subject: [PATCH] Prepare publications list for name change --- data/facts.yml | 10 ++++--- layouts/shortcodes/cv/publications.gohtml | 34 +++++++++++++++-------- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/data/facts.yml b/data/facts.yml index 5ff1cea..2bc5b6f 100644 --- a/data/facts.yml +++ b/data/facts.yml @@ -1,9 +1,11 @@ name: Jan Heinrich Reimer +aliases: + - Jan Heinrich Merker address: - street: "Hohestieg 12" - zip: "38118" - city: "Braunschweig" - country: "Deutschland" + street: Hohestieg 12 + zip: 38118 + city: Braunschweig + country: Deutschland birthday: 1998-01-25 mail: heinrich@reimer.family phone: +49 174 9273954 diff --git a/layouts/shortcodes/cv/publications.gohtml b/layouts/shortcodes/cv/publications.gohtml index 099d4f6..0c2b539 100644 --- a/layouts/shortcodes/cv/publications.gohtml +++ b/layouts/shortcodes/cv/publications.gohtml @@ -1,4 +1,7 @@ -{{- $author := site.Data.facts.name -}} +{{- $authors := slice site.Data.facts.name -}} +{{- with site.Data.facts.aliases -}} + {{- $authors = $authors | collections.Append . -}} +{{- end -}} {{- $webisPublicationsUrl := "https://webis.de/publications.html" -}} @@ -73,8 +76,15 @@ {{/* Filter author entries. */}} {{- $authorEntries := slice -}} {{- range $entries -}} - {{- if or (not $author) (in (index . "-data-author") $author) -}} - {{- $authorEntries = $authorEntries | append . -}} + {{- $entry := . -}} + {{- $fromAuthor := false -}} + {{- range $authors -}} + {{- if in (index $entry "-data-author") . -}} + {{- $fromAuthor = true -}} + {{- end -}} + {{- end -}} + {{- if $fromAuthor -}} + {{- $authorEntries = $authorEntries | append $entry -}} {{- end -}} {{- end -}} @@ -221,13 +231,17 @@ {{- range $coauthorIndex, $coauthor := $coauthors -}} + {{- $marked := false -}} + {{- range $authors -}} + {{- if in . $coauthor -}} + {{- $marked = true -}} + {{- end -}} + {{- end -}} {{- if gt $coauthorIndex 0 -}} {{- ", " -}} {{- end -}} - {{- if $author -}} - {{- if in $author $coauthor -}} - - {{- end -}} + {{- if $marked -}} + {{- end -}} {{- $nameParts := split $coauthor " " -}} {{- range $namePartIndex, $namePart := $nameParts -}} @@ -238,10 +252,8 @@ {{- ". " -}} {{- end -}} {{- end -}} - {{- if $author -}} - {{- if in $author $coauthor -}} - - {{- end -}} + {{- if $marked -}} + {{- end -}} {{- end -}} {{- ". " -}}