jekyll-cloudinary 1.2.5 → 1.2.6
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/lib/jekyll/cloudinary/version.rb +1 -1
- data/lib/jekyll/cloudinary.rb +7 -5
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a3308a42b1dad8497bd451c773ea01b223f00b41
|
|
4
|
+
data.tar.gz: cc962117a3eae7d9f0fc0c8f9237f874043201ba
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: beb1f8eee495ca26a301307c948dd4820bef808263f54ad61ef3a1a059b036254db2a77e519d1c54cb100c6f7bf2cd7c725ed330deb10404f4bc44b94ea0fa98
|
|
7
|
+
data.tar.gz: 8bf9848b57654765c8f8587cb3a13800827da9baaa45f79077e8947e85679928f2b683d406c4d947aa269c9ec49bca34c8b2fdce744050c30082d8439652dab4
|
data/lib/jekyll/cloudinary.rb
CHANGED
|
@@ -42,7 +42,9 @@ module Jekyll
|
|
|
42
42
|
|
|
43
43
|
# Extract tag segments
|
|
44
44
|
markup = /^(?:(?<preset>[^\s.:\/]+)\s+)?(?<image_src>[^\s]+\.[a-zA-Z0-9]{3,4})\s*(?<html_attr>[\s\S]+)?$/.match(rendered_markup)
|
|
45
|
-
|
|
45
|
+
if !markup
|
|
46
|
+
Jekyll.logger.abort_with('Cloudinary', "Cloudinary can't read this tag: #{@markup}. Try {% cloudinary [preset] path/to/img.jpg [attr=\"value\"] %}.")
|
|
47
|
+
end
|
|
46
48
|
|
|
47
49
|
image_src = markup[:image_src]
|
|
48
50
|
|
|
@@ -63,7 +65,7 @@ module Jekyll
|
|
|
63
65
|
else
|
|
64
66
|
natural_width = 100000
|
|
65
67
|
if settings['verbose']
|
|
66
|
-
|
|
68
|
+
Jekyll.logger.warn('Cloudinary', "[Cloudinary] Couldn't find this image to check its width: #{image_path}")
|
|
67
69
|
end
|
|
68
70
|
end
|
|
69
71
|
|
|
@@ -72,7 +74,7 @@ module Jekyll
|
|
|
72
74
|
preset = preset.merge(settings['presets'][markup[:preset]])
|
|
73
75
|
else
|
|
74
76
|
if settings['verbose']
|
|
75
|
-
|
|
77
|
+
Jekyll.logger.warn('Cloudinary', "[Cloudinary] '#{markup[:preset]}' preset for the Cloudinary plugin doesn't exist in _config.yml, using the default one")
|
|
76
78
|
end
|
|
77
79
|
end
|
|
78
80
|
end
|
|
@@ -127,7 +129,7 @@ module Jekyll
|
|
|
127
129
|
|
|
128
130
|
if natural_width < min_width
|
|
129
131
|
if settings['verbose']
|
|
130
|
-
|
|
132
|
+
Jekyll.logger.warn('Cloudinary', "[Cloudinary] Natural width of source image '#{File.basename(image_src)}' (#{natural_width}px) in #{context['page'].path} not enough for creating any srcset version")
|
|
131
133
|
end
|
|
132
134
|
srcset << "https://res.cloudinary.com/#{settings['cloud_name']}/image/fetch/q_auto,f_auto/#{image_url} #{natural_width}w"
|
|
133
135
|
else
|
|
@@ -137,7 +139,7 @@ module Jekyll
|
|
|
137
139
|
srcset << "https://res.cloudinary.com/#{settings['cloud_name']}/image/fetch/c_scale,w_#{width},q_auto,f_auto/#{image_url} #{width}w"
|
|
138
140
|
else
|
|
139
141
|
if settings['verbose']
|
|
140
|
-
|
|
142
|
+
Jekyll.logger.warn('Cloudinary', "[Cloudinary] Natural width of source image '#{File.basename(image_src)}' (#{natural_width}px) in #{context['page'].path} not enough for creating #{width}px version")
|
|
141
143
|
end
|
|
142
144
|
end
|
|
143
145
|
end
|