From 488cb39f9cedc1cf50af780bb71ac5232ef92ebf Mon Sep 17 00:00:00 2001 From: Tiago Tresoldi Date: Sun, 30 Sep 2018 21:08:54 +0200 Subject: [PATCH] Fixes bug when generating publications from single authors. (#27) * Fixes bug when generating publications from single authors. * Fixes generation of author string for multiple authors * Fixed number of spaces in indentation --- _layouts/bib.html | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/_layouts/bib.html b/_layouts/bib.html index d58da20..0f5989c 100644 --- a/_layouts/bib.html +++ b/_layouts/bib.html @@ -16,28 +16,35 @@ {{entry.title}} {% for author in entry.author_array %} - {% unless forloop.last %} - {% if author.last == site.scholar.last_name %} - {{author.last}}, {{author.first}}, - {% else %} - {% if site.data.coauthors[author.last] %} - {{author.last}}, {{author.first}}, - {% else %} - {{author.last}}, {{author.first}}, - {% endif %} - {% endif %} - {% else %} - and + {% if forloop.length == 1 %} {% if author.last == site.scholar.last_name %} {{author.last}}, {{author.first}} {% else %} - {% if site.data.coauthors[author.last] %} - {{author.last}}, {{author.first}} - {% else %} - {{author.last}}, {{author.first}} - {% endif %} + {{author.last}}, {{author.first}} {% endif %} - {% endunless %} + {% else %} + {% unless forloop.last %} + {% if author.last == site.scholar.last_name %} + {{author.last}}, {{author.first}}, + {% else %} + {% if site.data.coauthors[author.last] %} + {{author.last}}, {{author.first}}, + {% else %} + {{author.last}}, {{author.first}}, + {% endif %} + {% endif %} + {% else %} + {% if author.last == site.scholar.last_name %} + and {{author.last}}, {{author.first}} + {% else %} + {% if site.data.coauthors[author.last] %} + and {{author.last}}, {{author.first}} + {% else %} + and {{author.last}}, {{author.first}} + {% endif %} + {% endif %} + {% endunless %} + {% endif %} {% endfor %}