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:
@@ -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=' %}
|
||||
|
||||
Reference in New Issue
Block a user