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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 00d8f5eb907d161fb34a2e022183c6eef7b1cd0e
4
- data.tar.gz: f2aea697598fc8eb21cf0b1a0258abb5fdd5bc26
3
+ metadata.gz: 6813e50567d2adc7d8ec44253770adc123308a47
4
+ data.tar.gz: 07f99bc511930a7d2fa98064df8aa8a113276f06
5
5
  SHA512:
6
- metadata.gz: b561217b336bb7e24904663bd5172a75149b7b27a9fd9e772014e8e0d3f2ea40ed7d367071433826b581123df6f01dac1dc16f7336fd11a3909c40ab82388f50
7
- data.tar.gz: 161c15acb522d0cfa6884980d1d2dc74a50ec76280bbf4b624e86652f07ff5b54cc41046eb08599a04665f29223a64d75e152a846a0160a07d3864f9dd3a4352
6
+ metadata.gz: e027169a6efb8ebdeb49d4d780a9038092b6e6d21d76488cc0fea29b5f14776f563b8a204cf47b7940d6af788c5782eca605930f3b12fdccf5306b8b9eb1c6fb
7
+ data.tar.gz: 084cb5267d7233cf535d2d57a2b5b3caf79a84733ac4dbca92ec1738d600d6e4ff25f60d277f32987ed7f72ef1928ff6a27b28bf0bade97abdd375d34c1ce3b1
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Cloudinary
3
- VERSION = "1.2.17".freeze
3
+ VERSION = "1.3.0".freeze
4
4
  end
5
5
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-cloudinary
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.17
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Hoizey