Prevent the site test from failing when the avatar is not assigned (close #418)

Some rookies like to do this :(
This commit is contained in:
Cotes Chung 2021-09-30 15:24:10 +08:00
parent 945e8d1953
commit a887f1d57d

View file

@ -6,6 +6,7 @@
<div class="profile-wrapper text-center">
<div id="avatar">
<a href="{{ '/' | relative_url }}" alt="avatar" class="mx-auto">
{% if site.avatar != '' and site.avatar %}
{% capture avatar_url %}
{%- if site.avatar contains '://' -%}
{{ site.avatar }}
@ -16,6 +17,7 @@
{%- endif -%}
{% endcapture %}
<img src="{{ avatar_url }}" alt="avatar" onerror="this.style.display='none'">
{% endif %}
</a>
</div>