Skip to content

Commit 2a4fbf6

Browse files
authored
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
1 parent 84ea68c commit 2a4fbf6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

_layouts/post.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ <h1 data-toc-skip>{{ page.title }}</h1>
6161
<em>
6262
{% if authors %}
6363
{% for author in authors %}
64-
<a href="{{ site.data.authors[author].url }}">{{ site.data.authors[author].name }}</a>
64+
{% if site.data.authors[author].url -%}
65+
<a href="{{ site.data.authors[author].url }}">{{ site.data.authors[author].name }}</a>
66+
{%- else -%}
67+
{{ site.data.authors[author].name }}
68+
{%- endif %}
6569
{% unless forloop.last %}{{ '</em>, <em>' }}{% endunless %}
6670
{% endfor %}
6771
{% else %}

0 commit comments

Comments
 (0)