jekyll-cloudinary 1.8.0 → 1.8.1
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 +17 -11
- data/lib/jekyll/cloudinary/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b863e9b4acab51ae62dbf96d68b43d059b6aab3
|
4
|
+
data.tar.gz: 2f6cdda99017506fb2146f67b046ef099e85a040
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7786281d3a9a2cbdc88e092edc8a528aeec9b22cec26394a0e86da19aa1f4845eab5db53265ef1f9c2fe51edcc9f35bf9680a528fba11bdbc502d24b8061c508
|
7
|
+
data.tar.gz: 760d8da6e314764339e04d2261f0ed9077499d3356a26c477f7f3ae3febf3da2fb62ad8f0e6e3d65976e1ea738fa2d00de469b427638500c0715cd8c4d6dfd90
|
data/lib/jekyll/cloudinary.rb
CHANGED
@@ -115,7 +115,7 @@ module Jekyll
|
|
115
115
|
end
|
116
116
|
|
117
117
|
image_src = markup[:image_src]
|
118
|
-
|
118
|
+
|
119
119
|
# Dynamic image type
|
120
120
|
type = "fetch"
|
121
121
|
# TODO: URL2PNG requires signed URLs… need to investigate more
|
@@ -123,7 +123,7 @@ module Jekyll
|
|
123
123
|
# type = "url2png"
|
124
124
|
# image_src.gsub! "url2png:", ""
|
125
125
|
# end
|
126
|
-
|
126
|
+
|
127
127
|
# Build source image URL
|
128
128
|
is_image_remote = /^https?/.match(image_src)
|
129
129
|
# It’s remote
|
@@ -217,19 +217,25 @@ module Jekyll
|
|
217
217
|
end
|
218
218
|
|
219
219
|
# Get source image natural width
|
220
|
-
if
|
220
|
+
if is_image_remote
|
221
221
|
natural_width, natural_height = FastImage.size(image_url)
|
222
222
|
width_height = "width=\"#{natural_width}\" height=\"#{natural_height}\""
|
223
223
|
fallback_url = "https://res.cloudinary.com/#{settings["cloud_name"]}/image/#{type}/#{transformations_string}w_#{preset["fallback_max_width"]}/#{image_url}"
|
224
224
|
else
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
"[
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
225
|
+
if File.exist?(image_path)
|
226
|
+
natural_width, natural_height = FastImage.size(image_path)
|
227
|
+
width_height = "width=\"#{natural_width}\" height=\"#{natural_height}\""
|
228
|
+
fallback_url = "https://res.cloudinary.com/#{settings["cloud_name"]}/image/#{type}/#{transformations_string}w_#{preset["fallback_max_width"]}/#{image_url}"
|
229
|
+
else
|
230
|
+
natural_width = 100_000
|
231
|
+
width_height = ""
|
232
|
+
Jekyll.logger.warn(
|
233
|
+
"[Cloudinary]",
|
234
|
+
"Couldn't find this image to check its width: #{image_path}. \
|
235
|
+
Try to run Jekyll build a second time."
|
236
|
+
)
|
237
|
+
fallback_url = image_url
|
238
|
+
end
|
233
239
|
end
|
234
240
|
|
235
241
|
srcset = []
|