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
1 changed files with 12 additions and 10 deletions

View File

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