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
This commit is contained in:
Tiago Tresoldi 2018-09-30 21:08:54 +02:00 committed by Maruan
parent 9cbed31f10
commit 488cb39f9c
1 changed files with 25 additions and 18 deletions

View File

@ -16,6 +16,13 @@
<span class="title">{{entry.title}}</span> <span class="title">{{entry.title}}</span>
<span class="author"> <span class="author">
{% for author in entry.author_array %} {% for author in entry.author_array %}
{% if forloop.length == 1 %}
{% if author.last == site.scholar.last_name %}
<em>{{author.last}}, {{author.first}}</em>
{% else %}
{{author.last}}, {{author.first}}
{% endif %}
{% else %}
{% unless forloop.last %} {% unless forloop.last %}
{% if author.last == site.scholar.last_name %} {% if author.last == site.scholar.last_name %}
<em>{{author.last}}, {{author.first}}</em>, <em>{{author.last}}, {{author.first}}</em>,
@ -27,17 +34,17 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
{% else %} {% else %}
and
{% if author.last == site.scholar.last_name %} {% if author.last == site.scholar.last_name %}
<em>{{author.last}}, {{author.first}}</em> and <em>{{author.last}}, {{author.first}}</em>
{% else %} {% else %}
{% if site.data.coauthors[author.last] %} {% if site.data.coauthors[author.last] %}
<a href="{{site.data.coauthors[author.last].url}}" target="_blank">{{author.last}}, {{author.first}}</a> and <a href="{{site.data.coauthors[author.last].url}}" target="_blank">{{author.last}}, {{author.first}}</a>
{% else %} {% else %}
{{author.last}}, {{author.first}} and {{author.last}}, {{author.first}}
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endunless %} {% endunless %}
{% endif %}
{% endfor %} {% endfor %}
</span> </span>