jekyll-cloudinary 1.3.1 → 1.4.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 +4 -4
- data/README.md +22 -20
- data/lib/jekyll/cloudinary.rb +3 -1
- data/lib/jekyll/cloudinary/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e87bef18b51070a637ae7539a13a638a27d571ca
|
4
|
+
data.tar.gz: 473cf42905c69823dc5ac3c76f62dd162955676c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a2b2b6167e9d6e7ffe0f2a54e17cb55790ca9d580c31bed43ba85188e2ad9f9b14d51d4c914916d4cb9ce0d8a3dea02e054824d0ae22f6d04c1ea7916a42240
|
7
|
+
data.tar.gz: 9d7dd0df1d856afff22e45abd35303f373a81f015f1d83078689afc49769769b8940281b2579e9917417e2ef942a0d6c64a8ae99aa7607dfb4643e9f5c75f4a8
|
data/README.md
CHANGED
@@ -5,9 +5,9 @@
|
|
5
5
|
|
6
6
|
`jekyll-cloudinary` is a [Jekyll](http://jekyllrb.com/) plugin adding a [Liquid](http://liquidmarkup.org) tag to ease the use of [Cloudinary](http://cloudinary.com/invites/lpov9zyyucivvxsnalc5/sgyyc0j14k6p0sbt51nw) for responsive images in your Markdown/[Kramdown](http://kramdown.gettalong.org/) posts.
|
7
7
|
|
8
|
-
It builds the HTML for responsive images in the posts, using the `srcset` and `sizes` attributes for the `<img />` tag (see [the "varying size and density" section of this post
|
8
|
+
It builds the HTML for responsive images in the posts, using the `srcset` and `sizes` attributes for the `<img />` tag (see [the "varying size and density" section of this post](https://jakearchibald.com/2015/anatomy-of-responsive-images/#varying-size-and-density) if this is new for you, and why it's recommended to [not use `<picture>` most of the time](https://cloudfour.com/thinks/dont-use-picture-most-of-the-time/)). URLs in the `srcset` are cloudinary URLs that [fetch on-the-fly](http://cloudinary.com/features#fetch) the post's images and resize them to several sizes.
|
9
9
|
|
10
|
-
You are in full control of the number of generated images and their
|
10
|
+
You are in full control of the number of generated images and their sizes, and the `sizes` attribute that helps the browser decide which image to download. See the complete configuration options for details.
|
11
11
|
|
12
12
|
Here is the general syntax of this Liquid tag:
|
13
13
|
|
@@ -42,7 +42,7 @@ Here is the general syntax of this Liquid tag:
|
|
42
42
|
|
43
43
|
## Installation
|
44
44
|
|
45
|
-
[Sign up for free on Cloudinary](http://cloudinary.com/invites/lpov9zyyucivvxsnalc5/sgyyc0j14k6p0sbt51nw)
|
45
|
+
[Sign up **for free** on Cloudinary!](http://cloudinary.com/invites/lpov9zyyucivvxsnalc5/sgyyc0j14k6p0sbt51nw) The free account should be enough for most blogs.
|
46
46
|
|
47
47
|
Add `gem 'jekyll-cloudinary'` to your `Gemfile` and run `bundle update` to install the gem.
|
48
48
|
|
@@ -119,16 +119,18 @@ To get this HTML:
|
|
119
119
|
|
120
120
|
```html
|
121
121
|
<img
|
122
|
-
src="https://<your-domain>/assets/img.jpg"
|
122
|
+
src="http://res.cloudinary.com/<cloud_name>/image/fetch/c_limit,w_480,q_auto,f_auto/https://<your-domain>/assets/img.jpg"
|
123
123
|
srcset="
|
124
|
-
http://res.cloudinary.com/<cloud_name>/image/fetch/
|
125
|
-
http://res.cloudinary.com/<cloud_name>/image/fetch/
|
126
|
-
http://res.cloudinary.com/<cloud_name>/image/fetch/
|
127
|
-
http://res.cloudinary.com/<cloud_name>/image/fetch/
|
128
|
-
http://res.cloudinary.com/<cloud_name>/image/fetch/
|
124
|
+
http://res.cloudinary.com/<cloud_name>/image/fetch/c_limit,w_320,q_auto,f_auto/https://<your-domain>/assets/img.jpg 320w,
|
125
|
+
http://res.cloudinary.com/<cloud_name>/image/fetch/c_limit,w_640,q_auto,f_auto/https://<your-domain>/assets/img.jpg 640w
|
126
|
+
http://res.cloudinary.com/<cloud_name>/image/fetch/c_limit,w_960,q_auto,f_auto/https://<your-domain>/assets/img.jpg 960w
|
127
|
+
http://res.cloudinary.com/<cloud_name>/image/fetch/c_limit,w_1280,q_auto,f_auto/https://<your-domain>/assets/img.jpg 1280w
|
128
|
+
http://res.cloudinary.com/<cloud_name>/image/fetch/c_limit,w_1600,q_auto,f_auto/https://<your-domain>/assets/img.jpg 1600w
|
129
129
|
"
|
130
130
|
sizes="(min-width: 50rem) 50rem, 90vw"
|
131
131
|
alt="beautiful!"
|
132
|
+
width="480"
|
133
|
+
height="320"
|
132
134
|
/>
|
133
135
|
```
|
134
136
|
|
@@ -256,11 +258,11 @@ It generates these HTML fragments (pretty printed here), for the logo:
|
|
256
258
|
|
257
259
|
```html
|
258
260
|
<img
|
259
|
-
src="https://nicolas-hoizey.com/assets/logos/cloudinary.png"
|
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"
|
260
262
|
srcset="
|
261
|
-
https://res.cloudinary.com/nho/image/fetch/
|
262
|
-
https://res.cloudinary.com/nho/image/fetch/
|
263
|
-
https://res.cloudinary.com/nho/image/fetch/
|
263
|
+
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
|
+
https://res.cloudinary.com/nho/image/fetch/c_limit,w_240,q_auto,f_auto/https://nicolas-hoizey.com/assets/logos/cloudinary.png 240w,
|
265
|
+
https://res.cloudinary.com/nho/image/fetch/c_limit,w_400,q_auto,f_auto/https://nicolas-hoizey.com/assets/logos/cloudinary.png 400w"
|
264
266
|
sizes="
|
265
267
|
(min-width: 50rem) 13rem,
|
266
268
|
(min-width: 40rem) 25vw,
|
@@ -277,12 +279,12 @@ And for the screenshot:
|
|
277
279
|
```html
|
278
280
|
<figure>
|
279
281
|
<img
|
280
|
-
src="https://nicolas-hoizey.com/2016/07/cloudinary-pricing.png"
|
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"
|
281
283
|
srcset="
|
282
|
-
https://res.cloudinary.com/nho/image/fetch/
|
283
|
-
https://res.cloudinary.com/nho/image/fetch/
|
284
|
-
https://res.cloudinary.com/nho/image/fetch/
|
285
|
-
https://res.cloudinary.com/nho/image/fetch/
|
284
|
+
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
|
+
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,
|
286
|
+
https://res.cloudinary.com/nho/image/fetch/c_limit,w_960,q_auto,f_auto/https://nicolas-hoizey.com/2016/07/cloudinary-pricing.png 960w,
|
287
|
+
https://res.cloudinary.com/nho/image/fetch/c_limit,w_1208,q_auto,f_auto/https://nicolas-hoizey.com/2016/07/cloudinary-pricing.png 1208w"
|
286
288
|
sizes="(min-width: 50rem) 50rem, 90vw"
|
287
289
|
alt="Les tarifs de Cloudinary"
|
288
290
|
width="1208"
|
@@ -322,8 +324,8 @@ article {
|
|
322
324
|
|
323
325
|
## To do
|
324
326
|
|
325
|
-
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!
|
327
|
+
There are already [a few issues for bugs and things that should be added to the plugin](https://github.com/nhoizey/jekyll-cloudinary/issues), feel free to add your ideas!
|
326
328
|
|
327
329
|
## Do you use the plugin on a live site?
|
328
330
|
|
329
|
-
|
331
|
+
Add it to [the "Sites" page of the wiki](https://github.com/nhoizey/jekyll-cloudinary/wiki/Sites) and please let me know on Twitter: [@nhoizey](https://twitter.com/nhoizey)
|
data/lib/jekyll/cloudinary.rb
CHANGED
@@ -24,6 +24,7 @@ module Jekyll
|
|
24
24
|
# Settings
|
25
25
|
site = context.registers[:site]
|
26
26
|
url = site.config["url"]
|
27
|
+
baseurl = site.config["baseurl"] || ""
|
27
28
|
settings = site.config["cloudinary"]
|
28
29
|
|
29
30
|
# Get Markdown converter
|
@@ -59,7 +60,7 @@ module Jekyll
|
|
59
60
|
is_image_path_absolute = %r!^/.*$!.match(image_src)
|
60
61
|
if is_image_path_absolute
|
61
62
|
image_path = File.join(site.config["destination"], image_src)
|
62
|
-
image_url = File.join(url, image_src)
|
63
|
+
image_url = File.join(url, baseurl, image_src)
|
63
64
|
else
|
64
65
|
image_path = File.join(
|
65
66
|
site.config["destination"],
|
@@ -68,6 +69,7 @@ module Jekyll
|
|
68
69
|
)
|
69
70
|
image_url = File.join(
|
70
71
|
url,
|
72
|
+
baseurl,
|
71
73
|
File.dirname(context["page"].url),
|
72
74
|
image_src
|
73
75
|
)
|
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.
|
4
|
+
version: 1.4.0
|
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-
|
11
|
+
date: 2016-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|