jekyll-cloudinary 1.2.17 → 1.3.0
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/lib/jekyll/cloudinary/version.rb +1 -1
- data/lib/jekyll/cloudinary.rb +5 -2
- 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: 6813e50567d2adc7d8ec44253770adc123308a47
|
|
4
|
+
data.tar.gz: 07f99bc511930a7d2fa98064df8aa8a113276f06
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e027169a6efb8ebdeb49d4d780a9038092b6e6d21d76488cc0fea29b5f14776f563b8a204cf47b7940d6af788c5782eca605930f3b12fdccf5306b8b9eb1c6fb
|
|
7
|
+
data.tar.gz: 084cb5267d7233cf535d2d57a2b5b3caf79a84733ac4dbca92ec1738d600d6e4ff25f60d277f32987ed7f72ef1928ff6a27b28bf0bade97abdd375d34c1ce3b1
|
data/lib/jekyll/cloudinary.rb
CHANGED
|
@@ -77,9 +77,12 @@ module Jekyll
|
|
|
77
77
|
if File.exist?(image_path)
|
|
78
78
|
image = Magick::Image::read(image_path).first
|
|
79
79
|
natural_width = image.columns
|
|
80
|
+
natural_height = image.rows
|
|
81
|
+
width_height = "width=\"#{natural_width}\" height=\"#{natural_height}\""
|
|
80
82
|
fallback_url = "https://res.cloudinary.com/#{settings["cloud_name"]}/image/fetch/c_limit,w_#{natural_width},q_auto,f_auto/#{image_url}"
|
|
81
83
|
else
|
|
82
84
|
natural_width = 100_000
|
|
85
|
+
width_height = ""
|
|
83
86
|
Jekyll.logger.warn(
|
|
84
87
|
"[Cloudinary]",
|
|
85
88
|
"Couldn't find this image to check its width: #{image_path}. \
|
|
@@ -183,9 +186,9 @@ module Jekyll
|
|
|
183
186
|
|
|
184
187
|
# preset['figure'] can be 'never', 'auto' or 'always'
|
|
185
188
|
if (caption || preset["figure"] == "always") && preset["figure"] != "never"
|
|
186
|
-
"\n<figure #{attr_string}>\n<img src=\"#{fallback_url}\" srcset=\"#{srcset_string}\" sizes=\"#{sizes}\" #{img_attr} />\n<figcaption>#{caption}</figcaption>\n</figure>\n"
|
|
189
|
+
"\n<figure #{attr_string}>\n<img src=\"#{fallback_url}\" srcset=\"#{srcset_string}\" sizes=\"#{sizes}\" #{img_attr} #{width_height} />\n<figcaption>#{caption}</figcaption>\n</figure>\n"
|
|
187
190
|
else
|
|
188
|
-
"<img src=\"#{fallback_url}\" srcset=\"#{srcset_string}\" sizes=\"#{sizes}\" #{attr_string} #{img_attr} />"
|
|
191
|
+
"<img src=\"#{fallback_url}\" srcset=\"#{srcset_string}\" sizes=\"#{sizes}\" #{attr_string} #{img_attr} #{width_height} />"
|
|
189
192
|
end
|
|
190
193
|
end
|
|
191
194
|
end
|