Skip to content

Commit 75e462a

Browse files
committed
Replaced the blank loading image with HTML trick.
1 parent ef38600 commit 75e462a

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

_layouts/post.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,9 @@ <h1 data-toc-skip>{{ page.title }}</h1>
6767
{% if page.image %}
6868
<img src="{{ page.image }}">
6969
{% endif %}
70-
<!-- Add lozad class into image tags. see: <https://github.com/ApoorvSaxena/lozad.js#usage> -->
70+
<!-- Using lozad. See: <https://github.com/ApoorvSaxena/lozad.js#usage> -->
7171
{% if content contains '<img src=' %}
72-
{% capture loading %}
73-
{{ "/assets/img/commons/loading.png" | relative_url }}
74-
{% endcapture %}
75-
{% assign replacement = '<img src=' | append: loading | append: ' data-src=' %}
76-
{{ content | replace: '<img src=', replacement }}
72+
{{ content | replace: '<img src=', '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-src=' }}
7773
{% else %}
7874
{{ content }}
7975
{% endif %}

assets/img/commons/loading.png

-99 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)