jekyll-cloudinary 1.5.2 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll/cloudinary.rb +18 -18
- data/lib/jekyll/cloudinary/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f72e7653facaf897ebb3b54dfbebbb08dd7382e7
|
4
|
+
data.tar.gz: 5f826cac5b07094b25965c88a3a9cacb98dfc6b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4bb1dd01c1efe5efd65ffab49da2e514cbb1956507433d8cccc7a149f4869d89c369c2b79b047fe7e86abb47d4eb5ccd0b97c8c9b2fc4e77e5872faf24a990b
|
7
|
+
data.tar.gz: a0522ff16af54368f09b8e1ec44454ab5b6ca5c45b1afebe5912b06bd9f846e2b6eab53f4699a66e540c28585a44b81a80217cb0274e9a749a627cb703ff7261
|
data/lib/jekyll/cloudinary.rb
CHANGED
@@ -76,24 +76,6 @@ module Jekyll
|
|
76
76
|
)
|
77
77
|
end
|
78
78
|
|
79
|
-
# Get source image natural width
|
80
|
-
if File.exist?(image_path)
|
81
|
-
image = Magick::Image::read(image_path).first
|
82
|
-
natural_width = image.columns
|
83
|
-
natural_height = image.rows
|
84
|
-
width_height = "width=\"#{natural_width}\" height=\"#{natural_height}\""
|
85
|
-
fallback_url = "https://res.cloudinary.com/#{settings["cloud_name"]}/image/fetch/c_limit,w_#{preset["fallback_max_width"]},q_auto,f_auto/#{image_url}"
|
86
|
-
else
|
87
|
-
natural_width = 100_000
|
88
|
-
width_height = ""
|
89
|
-
Jekyll.logger.warn(
|
90
|
-
"[Cloudinary]",
|
91
|
-
"Couldn't find this image to check its width: #{image_path}. \
|
92
|
-
Try to run Jekyll build a second time."
|
93
|
-
)
|
94
|
-
fallback_url = image_url
|
95
|
-
end
|
96
|
-
|
97
79
|
if markup[:preset]
|
98
80
|
if settings["presets"][markup[:preset]]
|
99
81
|
preset = preset.merge(settings["presets"][markup[:preset]])
|
@@ -147,6 +129,24 @@ module Jekyll
|
|
147
129
|
|
148
130
|
attr_string = html_attr.map { |a, v| "#{a}=\"#{v}\"" }.join(" ")
|
149
131
|
|
132
|
+
# Get source image natural width
|
133
|
+
if File.exist?(image_path)
|
134
|
+
image = Magick::Image::read(image_path).first
|
135
|
+
natural_width = image.columns
|
136
|
+
natural_height = image.rows
|
137
|
+
width_height = "width=\"#{natural_width}\" height=\"#{natural_height}\""
|
138
|
+
fallback_url = "https://res.cloudinary.com/#{settings["cloud_name"]}/image/fetch/c_limit,w_#{preset["fallback_max_width"]},q_auto,f_auto/#{image_url}"
|
139
|
+
else
|
140
|
+
natural_width = 100_000
|
141
|
+
width_height = ""
|
142
|
+
Jekyll.logger.warn(
|
143
|
+
"[Cloudinary]",
|
144
|
+
"Couldn't find this image to check its width: #{image_path}. \
|
145
|
+
Try to run Jekyll build a second time."
|
146
|
+
)
|
147
|
+
fallback_url = image_url
|
148
|
+
end
|
149
|
+
|
150
150
|
srcset = []
|
151
151
|
steps = preset["steps"].to_i
|
152
152
|
min_width = preset["min_width"].to_i
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-cloudinary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Hoizey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|