jekyll-cloudinary 1.5.1 → 1.5.2

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: 7217937a34d1e668a7a405f87ce5b8e324b5a9bc
4
- data.tar.gz: d9445e7192d3ded7780a1dddd31e923178aee1db
3
+ metadata.gz: a32c2a7afd71bd1b4558a21ca92bdf577ef5d604
4
+ data.tar.gz: 6360f0555e00eec720ad2eab186e81412fb8362b
5
5
  SHA512:
6
- metadata.gz: aa183f3520be07af0f2697728c3426e84177292e9de2185f8f7c8e715dbae439a42268b1939817598f164844fc6f882dbc1031605bc0cf998204f37f1371b96b
7
- data.tar.gz: 7431f4dfd321718045774f2d113759cb85583f2ae742c2fcb440dace73a2963b9d11000bdde3a9494780129f4a1fd58bcc5d0377536332f9f9a5c6641f0971fe
6
+ metadata.gz: 82f673fa5c1ce36c187ffd48fe0075870e02c0d0f4d7ae055a7fe469067284e7d73ee1b401108f765f0b2630da3e2080413aa07dbcfbd7cc72f268f1d4bb0fcd
7
+ data.tar.gz: d86d4f0b9f2ef8cc2a2f5feb0f84201a34803d6f342d3b2ed151509a4c67a61a8c2e1ded61f2970741aa094b5aad4c9a4e6d4a38a59befee351cf2de1e53076b
data/README.md CHANGED
@@ -29,8 +29,9 @@ Here is the general syntax of this Liquid tag:
29
29
  - [Additional presets](#additional-presets)
30
30
  - [Detailed preset settings](#detailed-preset-settings)
31
31
  - [`figure` (default: `auto`)](#figure-default-auto)
32
- - [`min_size` (default: `320`)](#min_size-default-320)
33
- - [`max_size` (default: `1200`)](#max_size-default-1200)
32
+ - [`min_width` (default: `320`)](#min_width-default-320)
33
+ - [`max_width` (default: `1200`)](#max_width-default-1200)
34
+ - [`fallback_max_width` (defaut: `1200`)](#fallback_max_width-defaut-1200)
34
35
  - [`steps` (default: `5`)](#steps-default-5)
35
36
  - [`sizes` (default: `"100vw"`)](#sizes-default-100vw)
36
37
  - [`attributes` (default: none)](#attributes-default-none)
@@ -101,13 +102,14 @@ cloudinary:
101
102
 
102
103
  presets:
103
104
  default:
104
- min_size: 320
105
- max_size: 1600
105
+ min_width: 320
106
+ max_width: 1600
107
+ fallback_max_width: 800
106
108
  steps: 5
107
109
  sizes: "(min-width: 50rem) 50rem, 90vw"
108
110
  ```
109
111
 
110
- This preset will generate five images 320 to 1600 pixels wide in the `srcset` and define `sizes` as `"(min-width: 50rem) 50rem, 90vw"`.
112
+ This preset will generate five images 320 to 1600 pixels wide in the `srcset` and define `sizes` as `"(min-width: 50rem) 50rem, 90vw"`. The fallback image defined in the `src` will have a width of 800 pixels.
111
113
 
112
114
  With this preset, you only have to write this in your Markdown post:
113
115
 
@@ -119,7 +121,7 @@ To get this HTML:
119
121
 
120
122
  ```html
121
123
  <img
122
- src="http://res.cloudinary.com/<cloud_name>/image/fetch/c_limit,w_480,q_auto,f_auto/https://<your-domain>/assets/img.jpg"
124
+ src="http://res.cloudinary.com/<cloud_name>/image/fetch/c_limit,w_800,q_auto,f_auto/https://<your-domain>/assets/img.jpg"
123
125
  srcset="
124
126
  http://res.cloudinary.com/<cloud_name>/image/fetch/c_limit,w_320,q_auto,f_auto/https://<your-domain>/assets/img.jpg 320w,
125
127
  http://res.cloudinary.com/<cloud_name>/image/fetch/c_limit,w_640,q_auto,f_auto/https://<your-domain>/assets/img.jpg 640w
@@ -134,7 +136,7 @@ To get this HTML:
134
136
  />
135
137
  ```
136
138
 
137
- There is a true default `default` preset, but you're strongly encouraged to define your own default preset.
139
+ There is a true default `default` preset, but you're strongly encouraged to override it with your own default preset.
138
140
 
139
141
  #### Additional presets
140
142
 
@@ -148,8 +150,9 @@ cloudinary:
148
150
  presets:
149
151
 
150
152
  onethird:
151
- min_size: 110
152
- max_size: 535
153
+ min_width: 110
154
+ max_width: 535
155
+ fallback_max_width: 300
153
156
  steps: 3
154
157
  sizes: "(min-width: 50rem) 17rem, 30vw"
155
158
  attributes:
@@ -186,9 +189,11 @@ The value can be:
186
189
 
187
190
  If a `<figure>` is generated and there are attributes in the Liquid tag, they are added to the `<img>` if they are `alt` or `title`, or to the `<figure>`.
188
191
 
189
- #### `min_size` (default: `320`)
192
+ #### `min_width` (default: `320`)
193
+
194
+ #### `max_width` (default: `1200`)
190
195
 
191
- #### `max_size` (default: `1200`)
196
+ #### `fallback_max_width` (defaut: `1200`)
192
197
 
193
198
  #### `steps` (default: `5`)
194
199
 
@@ -241,12 +246,14 @@ cloudinary:
241
246
  default:
242
247
  min_width: 320
243
248
  max_width: 1600
249
+ fallback_max_width: 800
244
250
  steps: 5
245
251
  sizes: '(min-width: 50rem) 50rem, 90vw'
246
252
  figure: always
247
253
  logo:
248
254
  min_width: 80
249
255
  max_width: 400
256
+ fallback_max_width: 200
250
257
  steps: 3
251
258
  sizes: '(min-width: 50rem) 13rem, (min-width: 40rem) 25vw, 45vw'
252
259
  figure: never
@@ -258,7 +265,7 @@ It generates these HTML fragments (pretty printed here), for the logo:
258
265
 
259
266
  ```html
260
267
  <img
261
- src="https://res.cloudinary.com/nho/image/fetch/c_limit,w_480,q_auto,f_auto/https://nicolas-hoizey.com/assets/logos/cloudinary.png"
268
+ src="https://res.cloudinary.com/nho/image/fetch/c_limit,w_200,q_auto,f_auto/https://nicolas-hoizey.com/assets/logos/cloudinary.png"
262
269
  srcset="
263
270
  https://res.cloudinary.com/nho/image/fetch/c_limit,w_80,q_auto,f_auto/https://nicolas-hoizey.com/assets/logos/cloudinary.png 80w,
264
271
  https://res.cloudinary.com/nho/image/fetch/c_limit,w_240,q_auto,f_auto/https://nicolas-hoizey.com/assets/logos/cloudinary.png 240w,
@@ -279,7 +286,7 @@ And for the screenshot:
279
286
  ```html
280
287
  <figure>
281
288
  <img
282
- src="https://res.cloudinary.com/nho/image/fetch/c_limit,w_1208,q_auto,f_auto/https://nicolas-hoizey.com/2016/07/cloudinary-pricing.png"
289
+ src="https://res.cloudinary.com/nho/image/fetch/c_limit,w_800,q_auto,f_auto/https://nicolas-hoizey.com/2016/07/cloudinary-pricing.png"
283
290
  srcset="
284
291
  https://res.cloudinary.com/nho/image/fetch/c_limit,w_320,q_auto,f_auto/https://nicolas-hoizey.com/2016/07/cloudinary-pricing.png 320w,
285
292
  https://res.cloudinary.com/nho/image/fetch/c_limit,w_640,q_auto,f_auto/https://nicolas-hoizey.com/2016/07/cloudinary-pricing.png 640w,
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Cloudinary
3
- VERSION = "1.5.1".freeze
3
+ VERSION = "1.5.2".freeze
4
4
  end
5
5
  end
@@ -82,7 +82,7 @@ module Jekyll
82
82
  natural_width = image.columns
83
83
  natural_height = image.rows
84
84
  width_height = "width=\"#{natural_width}\" height=\"#{natural_height}\""
85
- fallback_url = "https://res.cloudinary.com/#{settings["cloud_name"]}/image/fetch/c_limit,w_#{settings["fallback_max_width"]},q_auto,f_auto/#{image_url}"
85
+ fallback_url = "https://res.cloudinary.com/#{settings["cloud_name"]}/image/fetch/c_limit,w_#{preset["fallback_max_width"]},q_auto,f_auto/#{image_url}"
86
86
  else
87
87
  natural_width = 100_000
88
88
  width_height = ""
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-cloudinary
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Hoizey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-23 00:00:00.000000000 Z
11
+ date: 2016-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll