fix: url-less authors should not have empty links (#1410)

The url field from authors.yml is optional, so no link should be
build when the url is empty or not defined.

Fix #1403
This commit is contained in:
Chuck Houpt 2023-12-06 09:38:11 -05:00 committed by GitHub
parent 84ea68cab0
commit 2a4fbf6a79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,7 +61,11 @@ tail_includes:
<em> <em>
{% if authors %} {% if authors %}
{% for author in authors %} {% for author in authors %}
<a href="{{ site.data.authors[author].url }}">{{ site.data.authors[author].name }}</a> {% if site.data.authors[author].url -%}
<a href="{{ site.data.authors[author].url }}">{{ site.data.authors[author].name }}</a>
{%- else -%}
{{ site.data.authors[author].name }}
{%- endif %}
{% unless forloop.last %}{{ '</em>, <em>' }}{% endunless %} {% unless forloop.last %}{{ '</em>, <em>' }}{% endunless %}
{% endfor %} {% endfor %}
{% else %} {% else %}