jekyll-cloudinary 1.2.12 → 1.2.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b246c491902619afcdf63c1326ea254c2413a18e
4
- data.tar.gz: 97e3c59828db17e0ede0d2a5a69f4609a31a8e51
3
+ metadata.gz: c6f0125c007baffaba36b821f460af3e35c4d73e
4
+ data.tar.gz: 191206258c2d9302ac85f2153d6a3efa2ded83b7
5
5
  SHA512:
6
- metadata.gz: 66c8f8dcefa2ed74d1751e7fa53d29d3875a072bcf49f3d3474c33dd0847ee23d7ef98514f53f2e47e68884262a6c7366da402f36aaac8b6b67bbe3033d78ec0
7
- data.tar.gz: 5f2d7cec68b5b7807bc0e77b7d4541223038da329d7793e0ecffeefa2048d0799186cf668d442f0eb559b17b43dcb1e06d852b3dc102cd3afc8b6bbca24387b3
6
+ metadata.gz: af59ac2328ef55cf83eabf1342ad8f84fe00e5fd8ed74604c50b325a530e9fea07a8d07cc8b50286ca40480ed81dbe015ba100f1f2d8b608f9784e6dc15022e8
7
+ data.tar.gz: 3e6f9ef5d0e59cadf9205bec54d531a7cf4f7bed6f1131d961dd1a5ae40c5c2769e86213b50be7c6dc96ee360376ed300715b8bce840bdb71999f903324b987b
data/README.md CHANGED
@@ -265,6 +265,8 @@ It generates these HTML fragments (pretty printed here), for the logo:
265
265
  45vw"
266
266
  class="logo"
267
267
  alt="Logo de Cloudinary"
268
+ width="480"
269
+ height="350"
268
270
  />
269
271
  ```
270
272
 
@@ -277,17 +279,18 @@ And for the screenshot:
277
279
  srcset="
278
280
  https://res.cloudinary.com/nho/image/fetch/c_scale,w_320,q_auto,f_auto/https://nicolas-hoizey.com/2016/07/cloudinary-pricing.png 320w,
279
281
  https://res.cloudinary.com/nho/image/fetch/c_scale,w_640,q_auto,f_auto/https://nicolas-hoizey.com/2016/07/cloudinary-pricing.png 640w,
280
- https://res.cloudinary.com/nho/image/fetch/c_scale,w_960,q_auto,f_auto/https://nicolas-hoizey.com/2016/07/cloudinary-pricing.png 960w"
281
- sizes="
282
- (min-width: 50rem) 50rem,
283
- 90vw"
282
+ https://res.cloudinary.com/nho/image/fetch/c_scale,w_960,q_auto,f_auto/https://nicolas-hoizey.com/2016/07/cloudinary-pricing.png 960w,
283
+ https://res.cloudinary.com/nho/image/fetch/c_scale,w_1208,q_auto,f_auto/https://nicolas-hoizey.com/2016/07/cloudinary-pricing.png 1208w"
284
+ sizes="(min-width: 50rem) 50rem, 90vw"
284
285
  alt="Les tarifs de Cloudinary"
286
+ width="1208"
287
+ height="561"
285
288
  />
286
289
  <figcaption>Les tarifs de Cloudinary, dont l'offre gratuite déjà généreuse</figcaption>
287
290
  </figure>
288
291
  ```
289
292
 
290
- There are only 3 version in the `srcset` here because 2 of the 5 sizes expected are larger than the source image.
293
+ There are only 4 version in the `srcset` here because 2 of the 5 expected sizes are larger than the source image, and are replaced by one using the native source image width.
291
294
 
292
295
  And here are the relevant parts of the accompanying CSS (in Sass form):
293
296
 
@@ -64,11 +64,13 @@ module Jekyll
64
64
  natural_width = image.columns
65
65
  natural_height = image.rows
66
66
  width_height = "width=\"#{natural_width}\" height=\"#{natural_height}\""
67
+ fallback_url = "https://res.cloudinary.com/#{settings['cloud_name']}/image/fetch/c_scale,w_#{natural_width},q_auto,f_auto/#{image_url}"
67
68
  else
68
69
  natural_width = 100000
69
70
  natural_height = 100000
70
71
  width_height = ""
71
- Jekyll.logger.warn('[Cloudinary]', "Couldn't find this image to check its width: #{image_path}")
72
+ Jekyll.logger.warn('[Cloudinary]', "Couldn't find this image to check its width: #{image_path}. Try to run Jekyll build a second time.")
73
+ fallback_url = "#{image_url}"
72
74
  end
73
75
 
74
76
  if markup[:preset]
@@ -156,9 +158,9 @@ module Jekyll
156
158
 
157
159
  # preset['figure'] can be 'never', 'auto' or 'always'
158
160
  if (caption || preset['figure'] == 'always') && preset['figure'] != 'never'
159
- "\n<figure #{attr_string}>\n<img src=\"#{image_url}\" srcset=\"#{srcset_string}\" sizes=\"#{sizes}\" #{img_attr} #{width_height} />\n<figcaption>#{caption}</figcaption>\n</figure>\n"
161
+ "\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"
160
162
  else
161
- "<img src=\"#{image_url}\" srcset=\"#{srcset_string}\" sizes=\"#{sizes}\" #{attr_string} #{img_attr} #{width_height} />"
163
+ "<img src=\"#{fallback_url}\" srcset=\"#{srcset_string}\" sizes=\"#{sizes}\" #{attr_string} #{img_attr} #{width_height} />"
162
164
  end
163
165
  end
164
166
  end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Cloudinary
3
- VERSION = "1.2.12"
3
+ VERSION = "1.2.13"
4
4
  end
5
5
  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.12
4
+ version: 1.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Hoizey