Fix avatar url when site.baseurl
exists (#253)
This commit is contained in:
parent
ef1d05d342
commit
6490b0fcbd
1 changed files with 10 additions and 11 deletions
|
@ -10,17 +10,16 @@
|
||||||
|
|
||||||
<div class="profile-wrapper text-center">
|
<div class="profile-wrapper text-center">
|
||||||
<div id="avatar">
|
<div id="avatar">
|
||||||
<a href="{{ site.baseurl }}/" alt="avatar" class="mx-auto">
|
<a href="{{ '/' | relative_url }}" alt="avatar" class="mx-auto">
|
||||||
{% assign avatar_url = site.avatar %}
|
{% capture avatar_url %}
|
||||||
|
{%- if site.avatar contains '://' -%}
|
||||||
{% unless avatar_url contains '://' %}
|
{{ site.avatar }}
|
||||||
{% if site.img_cdn %}
|
{%- elsif site.img_cdn != '' and site.img_cdn -%}
|
||||||
{% assign avatar_url = avatar_url | prepend: site.img_cdn %}
|
{{ site.avatar | prepend: site.img_cdn }}
|
||||||
{% else %}
|
{%- else -%}
|
||||||
{% assign avatar_url = avatar_url | relative_url %}
|
{{ site.avatar | relative_url }}
|
||||||
{% endif %}
|
{%- endif -%}
|
||||||
{% endunless %}
|
{% endcapture %}
|
||||||
|
|
||||||
<img src="{{ avatar_url }}" alt="avatar" onerror="this.style.display='none'">
|
<img src="{{ avatar_url }}" alt="avatar" onerror="this.style.display='none'">
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue