From 1351d104862ccbc74996989366807512dc3d8df1 Mon Sep 17 00:00:00 2001 From: Romain <10656815+romsto@users.noreply.github.com> Date: Thu, 26 Sep 2024 07:37:37 +0000 Subject: [PATCH] Bold the author name in person's publications --- _layouts/person.html | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/_layouts/person.html b/_layouts/person.html index 54ce24b..3cab203 100644 --- a/_layouts/person.html +++ b/_layouts/person.html @@ -58,11 +58,31 @@

Contact

{{ content }} + {% assign alpha_chars = "abcdefghijklmnopqrstuvwxyzï" | split: "" %} {% assign pubname = last_name | append: " " | append: first_name | downcase %} {% assign ppublication = "" %} {% for publications-year in site.data.publications %} {% for publication in publications-year.papers %} - {% assign authors = publication.authors %} + {% assign authorslist = publication.authors | split: ", " %} + {% assign authors = "" %} + {% for author in authorslist %} + {% assign lcaseauthor = author | downcase %} + {% if lcaseauthor contains pubname %} + {% assign chars = author | split: "" %} + {% for char in chars %} + {% assign lowerchar = char | downcase %} + {% if alpha_chars contains lowerchar %} + {% assign authors = authors | append: "" | append: char | append: "" %} + {% else %} + {% assign authors = authors | append: char %} + {% endif %} + {% endfor %} + {% assign authors = authors | append: ", " %} + {% else %} + {% assign authors = authors | append: author | append: ", " %} + {% endif %} + {% endfor %} + {% assign authors = authors | append: "@" | replace: ", @", "." %} {% assign downcasedauthors = publication.authors | downcase %} {% if downcasedauthors contains pubname %} {% if publication.url %} @@ -82,9 +102,9 @@

Publications

{% for publication in ppublication %} {% assign ppublication_detail = publication | split: "|" %} {% if ppublication_detail.size > 2 %} -
  • {{ ppublication_detail[0] }}, {{ ppublication_detail[1] }}
    {{ ppublication_detail[2] }}
  • +
  • {{ ppublication_detail[0] }}, {{ ppublication_detail[1] }}
    {{ ppublication_detail[2] }}
  • {% else %} -
  • {{ ppublication_detail[0] }}, {{ ppublication_detail[1] }}
    {{ ppublication_detail[2] }}
  • +
  • {{ ppublication_detail[0] }}, {{ ppublication_detail[1] }}
    {{ ppublication_detail[2] }}
  • {% endif %} {% endfor %}