From 5fdea967706a143b13b5fed0bee10b85ddb209e6 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <schaller@strw.leidenuniv.nl> Date: Tue, 4 Jul 2023 10:04:04 +0200 Subject: [PATCH] Protect the code against ADS entries without authors --- templates/pubs.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/templates/pubs.html b/templates/pubs.html index de7fbeb..79002ee 100644 --- a/templates/pubs.html +++ b/templates/pubs.html @@ -39,10 +39,12 @@ <div class="card-text"> <h4>{{ count + 1 - loop.index }}) <a href="https://ui.adsabs.harvard.edu/abs/{{ card.bibcode }}/abstract">{{ card.title }}</a></h4> <p> - {% if card.author_count > 1 %} -   {{ card.first_author_norm }} et al., - {% else %} -   {{ card.first_author_norm }}, + {% if card.author_count %} + {% if card.author_count > 1 %} +   {{ card.first_author_norm }} et al., + {% else %} +   {{ card.first_author_norm }}, + {% endif %} {% endif %} <i>{{ card.bibstem }}</i>, {{ card.year }} {% if card.bibstem != "arXiv" %} -- GitLab