jekyll-cloudinary 1.2.8 → 1.2.9

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: 3f60fc40da066fe9ff55115d36284438bb0671df
4
- data.tar.gz: 5f68e842e562922619f94d6a1a2bc86b7a57db2d
3
+ metadata.gz: f95c301d8482d4ca7cdc8b2009e5f55608e0650b
4
+ data.tar.gz: 56e0239a2192f6278f0eca2780bb93ed07ff8844
5
5
  SHA512:
6
- metadata.gz: 0ad9a34e528d6b90d50604f7bc8e254b0bcca0357ddfda87499e28c4d451b29745c4ed1fc8824dfef3f34d4d79a7922e3ef20407cdea9a2ae81b2b3030e26ec8
7
- data.tar.gz: b106f20dc583ffe4533bdb743559506e7c60cf2c9d7bd4064c94277e9742d1b1157fc619d4eb37f195ded8742bd0ceea36cd3b3dc7c783dbcaa0a803b8e02c0d
6
+ metadata.gz: 25338e2042f4750a18f48d22dea9ef497f8073a705f8d4950048d87d9eee4b60bca82013e54e7f00c650849795a5c94e759b585e91fda0bd3790425c3b7a58c6
7
+ data.tar.gz: a833a2fcb7c52364bb377ba8d9edc043499e3ea446d3175efe4e15f944e7197863f27352b4dbd82cb6ea30a2f4ccf943221c42d647cfb578b50fc2ccf7d66134
data/README.md CHANGED
@@ -175,3 +175,125 @@ You can obviously define the `alt` attribute, mandatory for accessibility, but y
175
175
 
176
176
  The `caption` attribute is the only one that can act differently, depending on the `figure` setting.
177
177
 
178
+ ## Live example
179
+
180
+ Go to this post: [https://nicolas-hoizey.com/2016/07/tout-change-rien-ne-change.html](https://nicolas-hoizey.com/2016/07/tout-change-rien-ne-change.html).
181
+
182
+ The source Markdown is here: [https://github.com/nhoizey/nicolas-hoizey.com/blob/master/_posts/2016/07/13-tout-change-rien-ne-change/2016-07-13-tout-change-rien-ne-change.md](https://github.com/nhoizey/nicolas-hoizey.com/blob/master/_posts/2016/07/13-tout-change-rien-ne-change/2016-07-13-tout-change-rien-ne-change.md).
183
+
184
+ The content is in french, yes, but look only at the images if you don't understand.
185
+
186
+ You'll find here:
187
+
188
+ - 2 logos floating on the right of the text (or centered on smaller screens): [Jekyll](http://jekyllrb.com/) and [Cloudinary](http://cloudinary.com/invites/lpov9zyyucivvxsnalc5/sgyyc0j14k6p0sbt51nw)
189
+ - 2 screenshots taking the whole width of the content: the [Cloudinary pricing table](http://cloudinary.com/pricing), and [Dareboost](https://www.dareboost.com/en/home)'s performance monitoring graph
190
+
191
+ These image types need different settings to deal with different sizes and position:
192
+
193
+ - screenshot always use the full content width, if they're wide enough
194
+ - logos are centered and take one half of the content width on small screens, and are floated and take one fourth of the content width on larger screens
195
+
196
+ This is how I use the Cloudinary Liquid tag for the Cloudinary logo and prices table screenshot:
197
+
198
+ ```liquid
199
+ {% cloudinary logo /assets/logos/cloudinary.png alt="Logo de Cloudinary" %}
200
+ {% cloudinary cloudinary-pricing.png alt="Les tarifs de Cloudinary" caption="Les tarifs de Cloudinary, dont l'offre gratuite déjà généreuse" %}
201
+ ```
202
+
203
+ The only difference is that I explicitly use the `logo` preset for the logo. The other image uses the `default` preset.
204
+
205
+ Here is the necessary configuration for this:
206
+
207
+ ```yaml
208
+ cloudinary:
209
+ cloud_name: …
210
+ verbose: false
211
+ presets:
212
+ default:
213
+ min_width: 320
214
+ max_width: 1600
215
+ steps: 5
216
+ sizes: '(min-width: 50rem) 50rem, 90vw'
217
+ figure: always
218
+ logo:
219
+ min_width: 80
220
+ max_width: 400
221
+ steps: 3
222
+ sizes: '(min-width: 50rem) 13rem, (min-width: 40rem) 25vw, 45vw'
223
+ figure: never
224
+ attributes:
225
+ class: logo
226
+ ```
227
+
228
+ It generates these HTML fragments (pretty printed here), for the logo:
229
+
230
+ ```html
231
+ <img
232
+ src="https://nicolas-hoizey.com/assets/logos/cloudinary.png"
233
+ srcset="
234
+ https://res.cloudinary.com/nho/image/fetch/c_scale,w_80,q_auto,f_auto/https://nicolas-hoizey.com/assets/logos/cloudinary.png 80w,
235
+ https://res.cloudinary.com/nho/image/fetch/c_scale,w_240,q_auto,f_auto/https://nicolas-hoizey.com/assets/logos/cloudinary.png 240w,
236
+ https://res.cloudinary.com/nho/image/fetch/c_scale,w_400,q_auto,f_auto/https://nicolas-hoizey.com/assets/logos/cloudinary.png 400w"
237
+ sizes="
238
+ (min-width: 50rem) 13rem,
239
+ (min-width: 40rem) 25vw,
240
+ 45vw"
241
+ class="logo"
242
+ alt="Logo de Cloudinary"
243
+ />
244
+ ```
245
+
246
+ And for the screenshot:
247
+
248
+ ```html
249
+ <figure>
250
+ <img
251
+ src="https://nicolas-hoizey.com/2016/07/cloudinary-pricing.png"
252
+ srcset="
253
+ 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,
254
+ 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,
255
+ 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"
256
+ sizes="
257
+ (min-width: 50rem) 50rem,
258
+ 90vw"
259
+ alt="Les tarifs de Cloudinary"
260
+ />
261
+ <figcaption>Les tarifs de Cloudinary, dont l'offre gratuite déjà généreuse</figcaption>
262
+ </figure>
263
+ ```
264
+
265
+ There are only 3 version in the `srcset` here because 2 of the 5 sizes expected are larger than the source image.
266
+
267
+ And here are the relevant parts of the accompanying CSS (in Sass form):
268
+
269
+ ```sass
270
+ article {
271
+ figure, img {
272
+ margin: 2em auto;
273
+ display: block;
274
+ max-width: 100%;
275
+ height: auto;
276
+ }
277
+ }
278
+
279
+ .logo {
280
+ display: block;
281
+ margin: 1em auto;
282
+ max-width: 50%;
283
+ height: auto;
284
+
285
+ @media (min-width: 40em) {
286
+ max-width: 25%;
287
+ float: right;
288
+ margin: 0 0 1em 1em;
289
+ }
290
+ }
291
+ ```
292
+
293
+ ## To do
294
+
295
+ There are already [a few issues for things that should be added to the plugin](https://github.com/nhoizey/jekyll-cloudinary/issues), feel free to add your ideas!
296
+
297
+ ## Do you use the plugin on a live site?
298
+
299
+ Please let me know on Twitter: [@nhoizey](https://twitter.com/nhoizey)
@@ -18,7 +18,7 @@ module Jekyll
18
18
  "max_width" => 1200,
19
19
  "steps" => 5,
20
20
  "sizes" => "100vw",
21
- "caption" => "auto",
21
+ "figure" => "auto",
22
22
  "attributes" => { },
23
23
  "verbose" => false
24
24
  }
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Cloudinary
3
- VERSION = "1.2.8"
3
+ VERSION = "1.2.9"
4
4
  end
5
5
  end
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.2.8
4
+ version: 1.2.9
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-07-13 00:00:00.000000000 Z
11
+ date: 2016-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll