Skip to content

Commit aba9468

Browse files
committed
fix(home): preview image missing [alt] and img_path (#1044)
Close #1044
1 parent de6ec65 commit aba9468

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

_layouts/home.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,15 @@
4848
{% if post.image.lqip %}
4949
{% capture lqip %}lqip="{{ post.image.lqip }}"{% endcapture %}
5050
{% endif %}
51-
<img src="{{ post.image.path | default: post.image }}" w="15" h="8" {{ lqip }}>
51+
52+
{% assign src = post.image.path | default: post.image %}
53+
{% unless src contains '//' %}
54+
{% assign src = post.img_path | append: '/' | append: src | replace: '//', '/' %}
55+
{% endunless %}
56+
57+
{% assign alt = post.image.alt | default: 'Preview Image' %}
58+
59+
<img src="{{ src }}" w="15" h="8" alt="{{ alt }}" {{ lqip }}>
5260
{% endif %}
5361

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

0 commit comments

Comments
 (0)