Skip to content

Commit

Permalink
fix(home): preview image missing [alt] and img_path (#1044)
Browse files Browse the repository at this point in the history
Close #1044
  • Loading branch information
cotes2020 committed May 18, 2023
1 parent de6ec65 commit aba9468
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,15 @@
{% if post.image.lqip %}
{% capture lqip %}lqip="{{ post.image.lqip }}"{% endcapture %}
{% endif %}
<img src="{{ post.image.path | default: post.image }}" w="15" h="8" {{ lqip }}>

{% assign src = post.image.path | default: post.image %}
{% unless src contains '//' %}
{% assign src = post.img_path | append: '/' | append: src | replace: '//', '/' %}
{% endunless %}

{% assign alt = post.image.alt | default: 'Preview Image' %}

<img src="{{ src }}" w="15" h="8" alt="{{ alt }}" {{ lqip }}>
{% endif %}

<div class="card-body d-flex flex-column">
Expand Down

0 comments on commit aba9468

Please sign in to comment.