jekyll-cloudinary 1.12.1 → 1.12.2
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/Gemfile +3 -2
- data/Rakefile +2 -0
- data/lib/jekyll-cloudinary.rb +2 -0
- data/lib/jekyll/cloudinary.rb +37 -35
- data/lib/jekyll/cloudinary/version.rb +3 -1
- metadata +17 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d39d5d7bdcaa38d3de57ddd3cbd10aa6ef579ebc7b18f642a5b63d34b6bb01bf
|
4
|
+
data.tar.gz: ee3cd5fff0010f4ca4d2bbb6cd0831271878879ba44f41ae7543cedcda583127
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48f1e535b94cdb6b209ba96bf1ca5f4da161bea9585e4d5b696258b3327e73990e3388b88ccc43afc4dd20e3f23532281584d32956e4d8fd357e4ba5bc2a4262
|
7
|
+
data.tar.gz: e6057c4fc852ccd784dc43ab5b8e5adab40766b1dc490cb888d29471fe3c10802ae8d283382ca2b36d194bda03bede9b45b8f99bf17cea781b6d05915a13e50a
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/lib/jekyll-cloudinary.rb
CHANGED
data/lib/jekyll/cloudinary.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Jekyll
|
2
4
|
module Cloudinary
|
3
5
|
|
@@ -52,37 +54,37 @@ module Jekyll
|
|
52
54
|
"page" => false,
|
53
55
|
"density" => false,
|
54
56
|
"flags" => false,
|
55
|
-
"transformation" => false
|
57
|
+
"transformation" => false,
|
56
58
|
}
|
57
59
|
|
58
60
|
# TODO: Add validation for this parameters
|
59
61
|
transformation_options = {
|
60
|
-
"height"
|
61
|
-
"crop"
|
62
|
-
"aspect_ratio"
|
63
|
-
"gravity"
|
64
|
-
"zoom"
|
65
|
-
"x"
|
66
|
-
"y"
|
67
|
-
"fetch_format"
|
68
|
-
"quality"
|
69
|
-
"radius"
|
70
|
-
"angle"
|
71
|
-
"effect"
|
72
|
-
"opacity"
|
73
|
-
"border"
|
74
|
-
"background"
|
75
|
-
"overlay"
|
76
|
-
"underlay"
|
77
|
-
"default_image"
|
78
|
-
"delay"
|
79
|
-
"color"
|
80
|
-
"color_space"
|
81
|
-
"dpr"
|
82
|
-
"page"
|
83
|
-
"density"
|
84
|
-
"flags"
|
85
|
-
"transformation"
|
62
|
+
"height" => "h",
|
63
|
+
"crop" => "c", # can include add-on: imagga_scale
|
64
|
+
"aspect_ratio" => "ar",
|
65
|
+
"gravity" => "g",
|
66
|
+
"zoom" => "z",
|
67
|
+
"x" => "x",
|
68
|
+
"y" => "y",
|
69
|
+
"fetch_format" => "f",
|
70
|
+
"quality" => "q", # can include add-on: jpegmini
|
71
|
+
"radius" => "r",
|
72
|
+
"angle" => "a",
|
73
|
+
"effect" => "e", # can include add-on: viesus_correct
|
74
|
+
"opacity" => "o",
|
75
|
+
"border" => "bo",
|
76
|
+
"background" => "b",
|
77
|
+
"overlay" => "l",
|
78
|
+
"underlay" => "u",
|
79
|
+
"default_image" => "d",
|
80
|
+
"delay" => "dl",
|
81
|
+
"color" => "co",
|
82
|
+
"color_space" => "cs",
|
83
|
+
"dpr" => "dpr",
|
84
|
+
"page" => "pg",
|
85
|
+
"density" => "dn",
|
86
|
+
"flags" => "fl",
|
87
|
+
"transformation" => "t",
|
86
88
|
}
|
87
89
|
|
88
90
|
# Settings
|
@@ -114,7 +116,7 @@ module Jekyll
|
|
114
116
|
rendered_markup = Liquid::Template
|
115
117
|
.parse(@markup)
|
116
118
|
.render(context)
|
117
|
-
.gsub(%r!\\\{\\\{|\\\{\\%!, '\{\{' =>
|
119
|
+
.gsub(%r!\\\{\\\{|\\\{\\%!, '\{\{' => "{{", '\{\%' => "{%")
|
118
120
|
|
119
121
|
# Extract tag segments
|
120
122
|
markup =
|
@@ -129,7 +131,7 @@ module Jekyll
|
|
129
131
|
|
130
132
|
# Dynamic image type
|
131
133
|
type = "fetch"
|
132
|
-
# TODO: URL2PNG requires signed URLs
|
134
|
+
# TODO: URL2PNG requires signed URLs... need to investigate more
|
133
135
|
# if /^url2png\:/.match(image_src)
|
134
136
|
# type = "url2png"
|
135
137
|
# image_src.gsub! "url2png:", ""
|
@@ -191,19 +193,19 @@ module Jekyll
|
|
191
193
|
# Figure out the Cloudinary transformations
|
192
194
|
transformations = []
|
193
195
|
transformations_string = ""
|
194
|
-
transformation_options.each do |
|
196
|
+
transformation_options.each do |key, shortcode|
|
195
197
|
if preset[key]
|
196
198
|
transformations << "#{shortcode}_#{preset[key]}"
|
197
199
|
end
|
198
200
|
end
|
199
|
-
|
200
|
-
transformations_string = transformations.compact.reject(&:empty?).join(
|
201
|
+
unless transformations.empty?
|
202
|
+
transformations_string = transformations.compact.reject(&:empty?).join(",") + ","
|
201
203
|
end
|
202
204
|
|
203
205
|
# Build source image URL
|
204
|
-
is_image_remote =
|
206
|
+
is_image_remote = %r!^https?!.match(image_src)
|
205
207
|
if is_image_remote
|
206
|
-
# It
|
208
|
+
# It's remote
|
207
209
|
image_dest_path = image_src
|
208
210
|
image_dest_url = image_src
|
209
211
|
natural_width, natural_height = FastImage.size(image_dest_url)
|
@@ -214,7 +216,7 @@ module Jekyll
|
|
214
216
|
width_height = "width=\"#{natural_width}\" height=\"#{natural_height}\""
|
215
217
|
fallback_url = "https://res.cloudinary.com/#{settings["cloud_name"]}/image/#{type}/#{transformations_string}w_#{preset["fallback_max_width"]}/#{image_dest_url}"
|
216
218
|
else
|
217
|
-
# It
|
219
|
+
# It's a local image
|
218
220
|
is_image_src_absolute = %r!^/.*$!.match(image_src)
|
219
221
|
if is_image_src_absolute
|
220
222
|
image_src_path = File.join(
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-cloudinary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.12.
|
4
|
+
version: 1.12.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Hoizey
|
@@ -11,87 +11,75 @@ cert_chain: []
|
|
11
11
|
date: 2018-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: fastimage
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '3.0'
|
20
|
-
- - "<"
|
17
|
+
- - "~>"
|
21
18
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
19
|
+
version: '2.0'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- - "
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '3.0'
|
30
|
-
- - "<"
|
24
|
+
- - "~>"
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
26
|
+
version: '2.0'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
28
|
+
name: jekyll
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
|
-
- - "
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '2.0'
|
40
|
-
- - "<"
|
31
|
+
- - "~>"
|
41
32
|
- !ruby/object:Gem::Version
|
42
|
-
version: '3.
|
33
|
+
version: '3.6'
|
43
34
|
type: :runtime
|
44
35
|
prerelease: false
|
45
36
|
version_requirements: !ruby/object:Gem::Requirement
|
46
37
|
requirements:
|
47
|
-
- - "
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: '2.0'
|
50
|
-
- - "<"
|
38
|
+
- - "~>"
|
51
39
|
- !ruby/object:Gem::Version
|
52
|
-
version: '3.
|
40
|
+
version: '3.6'
|
53
41
|
- !ruby/object:Gem::Dependency
|
54
42
|
name: bundler
|
55
43
|
requirement: !ruby/object:Gem::Requirement
|
56
44
|
requirements:
|
57
45
|
- - "~>"
|
58
46
|
- !ruby/object:Gem::Version
|
59
|
-
version: '1.
|
47
|
+
version: '1.16'
|
60
48
|
type: :development
|
61
49
|
prerelease: false
|
62
50
|
version_requirements: !ruby/object:Gem::Requirement
|
63
51
|
requirements:
|
64
52
|
- - "~>"
|
65
53
|
- !ruby/object:Gem::Version
|
66
|
-
version: '1.
|
54
|
+
version: '1.16'
|
67
55
|
- !ruby/object:Gem::Dependency
|
68
56
|
name: rake
|
69
57
|
requirement: !ruby/object:Gem::Requirement
|
70
58
|
requirements:
|
71
59
|
- - "~>"
|
72
60
|
- !ruby/object:Gem::Version
|
73
|
-
version: '
|
61
|
+
version: '12.0'
|
74
62
|
type: :development
|
75
63
|
prerelease: false
|
76
64
|
version_requirements: !ruby/object:Gem::Requirement
|
77
65
|
requirements:
|
78
66
|
- - "~>"
|
79
67
|
- !ruby/object:Gem::Version
|
80
|
-
version: '
|
68
|
+
version: '12.0'
|
81
69
|
- !ruby/object:Gem::Dependency
|
82
70
|
name: rubocop
|
83
71
|
requirement: !ruby/object:Gem::Requirement
|
84
72
|
requirements:
|
85
73
|
- - "~>"
|
86
74
|
- !ruby/object:Gem::Version
|
87
|
-
version: 0.
|
75
|
+
version: 0.55.0
|
88
76
|
type: :development
|
89
77
|
prerelease: false
|
90
78
|
version_requirements: !ruby/object:Gem::Requirement
|
91
79
|
requirements:
|
92
80
|
- - "~>"
|
93
81
|
- !ruby/object:Gem::Version
|
94
|
-
version: 0.
|
82
|
+
version: 0.55.0
|
95
83
|
description: " Liquid tag to use Cloudinary for optimized responsive posts images.\n"
|
96
84
|
email:
|
97
85
|
- nicolas@hoizey.com
|