Skip to content

Commit 3bd881d

Browse files
authored
fix(post, page): image link loses shimmer effect (#1046)
1 parent aba9468 commit 3bd881d

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

_includes/refactor-content.html

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<!--
2-
Refactor the HTML structure.
3-
-->
1+
<!-- Refactor the HTML structure -->
42

53
{% assign _content = include.content %}
64

@@ -44,9 +42,9 @@
4442
{% endif %}
4543

4644
<!-- images -->
45+
{% assign IMG_TAG = '<img ' %}
4746

48-
{% if _content contains '<img' %}
49-
{% assign IMG_TAG = '<img ' %}
47+
{% if _content contains IMG_TAG %}
5048
{% assign _img_content = nil %}
5149
{% assign _img_snippets = _content | split: IMG_TAG %}
5250

@@ -160,7 +158,15 @@
160158
<!-- Bypass the HTML-proofer test -->
161159
{% assign _left = _left | append: ' data-proofer-ignore' %}
162160

163-
{% if page.layout == 'post' %}
161+
{% if page.layout == 'home' %}
162+
<!-- create the image wrapper -->
163+
{%- capture _wrapper_start -%}
164+
<div class="preview-img {{ _class | strip }}">
165+
{%- endcapture -%}
166+
{% assign _img_content = _img_content | append: _wrapper_start %}
167+
{% assign _right = _right | prepend: '></div' %}
168+
169+
{% else %}
164170
<!-- make sure the `<img>` is wrapped by `<a>` -->
165171
{% assign _parent = _right | slice: 1, 4 %}
166172

@@ -179,16 +185,6 @@
179185
{% assign _img_content = _img_content | append: _wrapper_start %}
180186
{% assign _right = _right | prepend: '></a' %}
181187
{% endif %}
182-
183-
{% endif %}
184-
185-
{% if page.layout == 'home' %}
186-
<!-- create the image wrapper -->
187-
{%- capture _wrapper_start -%}
188-
<div class="preview-img {{ _class | strip }}">
189-
{%- endcapture -%}
190-
{% assign _img_content = _img_content | append: _wrapper_start %}
191-
{% assign _right = _right | prepend: '></div' %}
192188
{% endif %}
193189

194190
<!-- combine -->

0 commit comments

Comments
 (0)