jekyll-cloudinary 1.2.14 → 1.2.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/jekyll/cloudinary.rb +4 -8
- data/lib/jekyll/cloudinary/version.rb +1 -1
- metadata +26 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 343d4c46dbcc0330c200f38793b923a357c828af
|
4
|
+
data.tar.gz: 5314f74f3c74aea64306d7dff45bb810ca9902ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1b35c1e6c71c1fd873435955820eaaa3243822cc949c9a6a590e55e04a3f0df34d5ad7c172d2d72d3cbfe275d52b07214f5b67954d1789a104f9389de359f7d
|
7
|
+
data.tar.gz: a70758fddcacd02ca3a50a4f8f6c459f572ae9c87db992f6bb289527b8462ceebbde4c9262af6fd7cf0426f06a38fedc6ef3439872062f06fe5dac9639fe3456
|
data/README.md
CHANGED
@@ -200,6 +200,8 @@ You can obviously define the `alt` attribute, mandatory for accessibility, but y
|
|
200
200
|
|
201
201
|
The `caption` attribute is the only one that can act differently, depending on the `figure` setting.
|
202
202
|
|
203
|
+
`alt`, `title` and `caption` attributes can contain Markdown.
|
204
|
+
|
203
205
|
## Live example
|
204
206
|
|
205
207
|
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).
|
data/lib/jekyll/cloudinary.rb
CHANGED
@@ -65,13 +65,9 @@ module Jekyll
|
|
65
65
|
if File.exist?(image_path)
|
66
66
|
image = Magick::Image::read(image_path).first
|
67
67
|
natural_width = image.columns
|
68
|
-
natural_height = image.rows
|
69
|
-
width_height = "width=\"#{natural_width}\" height=\"#{natural_height}\""
|
70
68
|
fallback_url = "https://res.cloudinary.com/#{settings['cloud_name']}/image/fetch/c_scale,w_#{natural_width},q_auto,f_auto/#{image_url}"
|
71
69
|
else
|
72
70
|
natural_width = 100000
|
73
|
-
natural_height = 100000
|
74
|
-
width_height = ""
|
75
71
|
Jekyll.logger.warn('[Cloudinary]', "Couldn't find this image to check its width: #{image_path}. Try to run Jekyll build a second time.")
|
76
72
|
fallback_url = "#{image_url}"
|
77
73
|
end
|
@@ -117,11 +113,11 @@ module Jekyll
|
|
117
113
|
# alt and title attributes should go only to the <img> even when there is a caption
|
118
114
|
img_attr = ""
|
119
115
|
if html_attr['alt']
|
120
|
-
img_attr << " alt=\"#{
|
116
|
+
img_attr << " alt=\"#{html_attr['alt']}\""
|
121
117
|
html_attr.delete('alt')
|
122
118
|
end
|
123
119
|
if html_attr['title']
|
124
|
-
img_attr << " title=\"#{
|
120
|
+
img_attr << " title=\"#{html_attr['title']}\""
|
125
121
|
html_attr.delete('title')
|
126
122
|
end
|
127
123
|
|
@@ -161,9 +157,9 @@ module Jekyll
|
|
161
157
|
|
162
158
|
# preset['figure'] can be 'never', 'auto' or 'always'
|
163
159
|
if (caption || preset['figure'] == 'always') && preset['figure'] != 'never'
|
164
|
-
"\n<figure #{attr_string}>\n<img src=\"#{fallback_url}\" srcset=\"#{srcset_string}\" sizes=\"#{sizes}\" #{img_attr}
|
160
|
+
"\n<figure #{attr_string}>\n<img src=\"#{fallback_url}\" srcset=\"#{srcset_string}\" sizes=\"#{sizes}\" #{img_attr} />\n<figcaption>#{caption}</figcaption>\n</figure>\n"
|
165
161
|
else
|
166
|
-
"<img src=\"#{fallback_url}\" srcset=\"#{srcset_string}\" sizes=\"#{sizes}\" #{attr_string} #{img_attr}
|
162
|
+
"<img src=\"#{fallback_url}\" srcset=\"#{srcset_string}\" sizes=\"#{sizes}\" #{attr_string} #{img_attr} />"
|
167
163
|
end
|
168
164
|
end
|
169
165
|
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.
|
4
|
+
version: 1.2.15
|
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-
|
11
|
+
date: 2016-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -17,9 +17,9 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3.0'
|
20
|
-
- - "
|
20
|
+
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '4.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,9 +27,29 @@ dependencies:
|
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '3.0'
|
30
|
-
- - "
|
30
|
+
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '4.0'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: rmagick
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '2.0'
|
40
|
+
- - "<"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '3.0'
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '2.0'
|
50
|
+
- - "<"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '3.0'
|
33
53
|
- !ruby/object:Gem::Dependency
|
34
54
|
name: bundler
|
35
55
|
requirement: !ruby/object:Gem::Requirement
|