jekyll-lazy-load-image 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/lib/jekyll-lazy-load-image/translator.rb +3 -7
- data/lib/jekyll-lazy-load-image/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c696ccda009d511e7958e9bfc2d59c155bc4b85ea2160953e3e49f45de30e500
|
4
|
+
data.tar.gz: 0474cee59f54ca296da5b17c5ccae7824cdc8b4778bd92337d4c4e4ac3b8224a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb9a1be310d069da1fdf10e8ba10b7e3e4adf2cdf7cb38478970e602812e5f26cd35dd10265d74f1b3facaa147268de8ec7257066e2b550c4b7f0624eb09b823
|
7
|
+
data.tar.gz: 67218bcbb1886e088b137b079ac13b37d632b39de79fbccf7e3a091523d6fcc1bcd4238802abde7200351bcc4a03c42e8749d450e8e223604e8ce949549eb5db
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Jekyll
|
1
|
+
# Jekyll Lazy Load Image [](https://travis-ci.org/kenchan0130/jekyll-lazy-load-image)
|
2
2
|
|
3
3
|
_Edit img tag optimized lazy load images for your Jekyll site_
|
4
4
|
|
@@ -8,7 +8,9 @@ _Edit img tag optimized lazy load images for your Jekyll site_
|
|
8
8
|
Add the following to your site's `Gemfile`:
|
9
9
|
|
10
10
|
```ruby
|
11
|
-
|
11
|
+
group :jekyll_plugins do
|
12
|
+
gem 'jekyll-lazy-load-image', require: 'jekyll-lazy-load-image/auto-execution'
|
13
|
+
end
|
12
14
|
```
|
13
15
|
|
14
16
|
and run bundle.
|
@@ -45,12 +45,8 @@ module JekyllLazyLoadImage
|
|
45
45
|
|
46
46
|
node.set_attribute("class", "") if class_value.nil?
|
47
47
|
node_class_attr = node.attributes["class"]
|
48
|
-
|
49
|
-
|
50
|
-
class_name.nil? || class_name.empty?
|
51
|
-
end
|
52
|
-
|
53
|
-
node_class_attr.value = normalize_class_array(class_array)
|
48
|
+
class_array = [node_class_attr.value, @site_config.class_attr_values].flatten
|
49
|
+
node_class_attr.value = normalize_class_array(class_array).join(" ")
|
54
50
|
end
|
55
51
|
|
56
52
|
def inject_additional_attrs(node)
|
@@ -64,7 +60,7 @@ module JekyllLazyLoadImage
|
|
64
60
|
end
|
65
61
|
|
66
62
|
def normalize_class_array(array)
|
67
|
-
array.map(&:strip).
|
63
|
+
array.compact.uniq.map(&:strip).reject(&:empty?)
|
68
64
|
end
|
69
65
|
end
|
70
66
|
end
|