mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-18 05:41:31 +00:00
refactor(core): optimize image loading
- JavaScript runs so fast that LQIP will never be detected - Increase the running priority of image processing in posts Enhancement for #1267
This commit is contained in:
@@ -81,6 +81,7 @@
|
||||
{% assign _left = _left | remove: ' /' | replace: ' w=', ' width=' | replace: ' h=', ' height=' %}
|
||||
{% assign _attrs = _left | split: '" ' %}
|
||||
|
||||
{% assign _src = null %}
|
||||
{% assign _lqip = null %}
|
||||
{% assign _class = null %}
|
||||
|
||||
@@ -119,8 +120,9 @@
|
||||
{% endunless %}
|
||||
|
||||
{% if _lqip %}
|
||||
{% if _lqip contains ':' %}
|
||||
{% if _lqip contains 'data:' %}
|
||||
{% assign _lazyload = false %}
|
||||
{% assign _class = _class | append: ' blur' %}
|
||||
{% else %}
|
||||
{% assign _lqip_alt = 'lqip="' | append: _path_prefix %}
|
||||
{% assign _left = _left | replace: 'lqip="', _lqip_alt %}
|
||||
|
||||
Reference in New Issue
Block a user