Skip to content

Commit

Permalink
fix: url-less authors should not have empty links (#1410)
Browse files Browse the repository at this point in the history
The url field from authors.yml is optional, so no link should be
build when the url is empty or not defined.

Fix #1403
  • Loading branch information
chuckhoupt authored Dec 6, 2023
1 parent 84ea68c commit 2a4fbf6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ <h1 data-toc-skip>{{ page.title }}</h1>
<em>
{% if 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 %}
{% endfor %}
{% else %}
Expand Down

0 comments on commit 2a4fbf6

Please sign in to comment.