1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 21:53:26 +00:00

fix: refactoring error when the image URL contains parameters

This commit is contained in:
Cotes Chung
2022-12-08 00:40:12 +08:00
parent e7426ec67e
commit ec98f07aca

View File

@@ -69,7 +69,7 @@
{% assign _attrs = _left | split: ' ' %} {% assign _attrs = _left | split: ' ' %}
{% for _attr in _attrs %} {% for _attr in _attrs %}
{% assign _pair = _attr | split: '=' %} {% assign _pair = _attr | split: '="' %}
{% if _pair.size < 2 %} {% if _pair.size < 2 %}
{% continue %} {% continue %}
{% endif %} {% endif %}
@@ -93,7 +93,6 @@
{% if _src %} {% if _src %}
{% unless _src contains '://' %} {% unless _src contains '://' %}
<!-- Add CDN URL --> <!-- Add CDN URL -->
{% if site.img_cdn %} {% if site.img_cdn %}
{% if site.img_cdn contains '//' %} {% if site.img_cdn contains '//' %}
@@ -117,7 +116,6 @@
{% endunless %} {% endunless %}
<!-- lazy-load images <https://github.com/ApoorvSaxena/lozad.js#usage> --> <!-- lazy-load images <https://github.com/ApoorvSaxena/lozad.js#usage> -->
{% assign _left = _left | replace: 'src=', 'data-src=' %} {% assign _left = _left | replace: 'src=', 'data-src=' %}
{% endif %} {% endif %}