1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 05:41:31 +00:00

refactor: optimize LQIP loading

- add blur effect for external WebP format LQIP
- remove the timeout delay
This commit is contained in:
Cotes Chung
2023-10-04 18:07:10 +08:00
parent 55659315c6
commit 2bc3172444
2 changed files with 34 additions and 34 deletions

View File

@@ -120,13 +120,13 @@
{% endunless %}
{% if _lqip %}
{% if _lqip contains 'data:' %}
{% assign _lazyload = false %}
{% assign _class = _class | append: ' blur' %}
{% else %}
{% assign _lazyload = false %}
{% assign _class = _class | append: ' blur' %}
{% unless _lqip contains 'data:' %}
{% assign _lqip_alt = 'lqip="' | append: _path_prefix %}
{% assign _left = _left | replace: 'lqip="', _lqip_alt %}
{% endif %}
{% endunless %}
<!-- add image placeholder -->
{% assign _left = _left | replace: 'src=', 'data-src=' | replace: ' lqip=', ' data-lqip="true" src=' %}