jekyll-cloudinary 1.2.0 → 1.2.1

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: f89661284c40115e8a2eb8bb429141d760f5255b
4
- data.tar.gz: b154e81a2d9b3fe2a22083d9d3a2b9cd035da01d
3
+ metadata.gz: 8b88743b6d8e43e1f63731ebf9facd6015946abd
4
+ data.tar.gz: ab101f22610ea9b6574e7cdb8a034100877f249f
5
5
  SHA512:
6
- metadata.gz: 227e844f37540fa5d33b88b0b83cfaeb2cf2e92b5752a0cd70b907d2f8ee3f23133851dbf7f148634cf8c1b0782d56bdc4a471655c1deef78d6d1e105789d240
7
- data.tar.gz: 980cc9a535c8a6508831ac5c9ee70ad33eb2bf49f0b1ad567e67c9530704e5054e195df39e2c6d4e18acfa7bc6ae9ee2c3898d15c8cc77f8b28a1959863ad53e
6
+ metadata.gz: eecfa7db628f70cf336dbe25b2a222e8048648c58bc2bc505143154a93856e8e202680f8d9313eb70ad6d31755b2e617099945e3b265bd3e27c2bdaaae56195f
7
+ data.tar.gz: 775812bfd5b70a0cf8849634fe380f2900b929efaf3bca925e034038697c95aac24a5beebd16619b1caf02fb15abcbb384db9298fce024d42dc670d807828fe3
data/README.md CHANGED
@@ -89,7 +89,19 @@ With this preset, you only have to write this in your Markdown post:
89
89
 
90
90
  To get this HTML:
91
91
 
92
-
92
+ ```html
93
+ <img
94
+ src="https://nicolas-hoizey.com/assets/img.jpg"
95
+ srcset="
96
+ http://res.cloudinary.com/<cloud_name>/image/fetch/c_scale,w_320,q_auto,f_auto/https://example.com/assets/img.jpg 320w,
97
+ http://res.cloudinary.com/<cloud_name>/image/fetch/c_scale,w_576,q_auto,f_auto/https://example.com/assets/img.jpg 576w,
98
+ http://res.cloudinary.com/<cloud_name>/image/fetch/c_scale,w_832,q_auto,f_auto/https://example.com/assets/img.jpg 832w,
99
+ http://res.cloudinary.com//image/fetch/c_scale,w_1088,q_auto,f_auto/https://example.com/assets/img.jpg 1088w,
100
+ http://res.cloudinary.com/<cloud_name>/image/fetch/c_scale,w_1344,q_auto,f_auto/https://example.com/assets/img.jpg 1344w,
101
+ http://res.cloudinary.com/<cloud_name>/image/fetch/c_scale,w_1600,q_auto,f_auto/https://example.com/assets/img.jpg 1600w"
102
+ sizes="(min-width: 50rem) 50rem, 90vw"
103
+ />
104
+ ```
93
105
 
94
106
  There is a true default default preset, but you're strongly encouraged to define your own default preset.
95
107
 
@@ -159,10 +171,3 @@ You can obviously define the `alt` attribute, mandatory for accessibility, but y
159
171
 
160
172
  The `caption` attribute is the only one that can act differently, depending on the `figure` setting.
161
173
 
162
- ## Examples
163
-
164
- ```liquid
165
- {% cloudinary image1.jpg alt="alternate" %}
166
- {% cloudinary onethird image2.jpg alt="other" title="yet another one" %}
167
- ```
168
-
@@ -123,7 +123,7 @@ module Jekyll
123
123
  steps = preset['steps'].to_i
124
124
  min_width = preset['min_width'].to_i
125
125
  max_width = preset['max_width'].to_i
126
- step_width = (max_width - min_width) / steps
126
+ step_width = (max_width - min_width) / (steps - 1)
127
127
  sizes = preset['sizes']
128
128
 
129
129
  if natural_width < min_width
@@ -132,8 +132,8 @@ module Jekyll
132
132
  end
133
133
  srcset << "http://res.cloudinary.com/#{settings['cloud_name']}/image/fetch/q_auto,f_auto/#{image_url} #{natural_width}w"
134
134
  else
135
- (0..steps).each do |factor|
136
- width = min_width + factor * step_width
135
+ (1..steps).each do |factor|
136
+ width = min_width + (factor - 1) * step_width
137
137
  if width <= natural_width
138
138
  srcset << "http://res.cloudinary.com/#{settings['cloud_name']}/image/fetch/c_scale,w_#{width},q_auto,f_auto/#{image_url} #{width}w"
139
139
  else
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Cloudinary
3
- VERSION = "1.2.0"
3
+ VERSION = "1.2.1"
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.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Hoizey