middleman-automatic-clowncar 4.0.3 → 4.0.4
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d761b96d5bf6a8657cc99f709bd1724df3c7bf675dba371003df2ef0d77257de
|
|
4
|
+
data.tar.gz: 5a7e76e82aa1d3afd78632ea06945f92fc3564f269d1e8a899e8853698050f11
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 14bcffaac1275723bdef8b4f7f6d430727b06723429768662c1d7c2c3745aa0c2ef2ef4857ad8819cfdcbb0f5b9d40a03e0acd22bd65d6be796784b86e696502
|
|
7
|
+
data.tar.gz: ea815b597181a54ec3ff929c486e3bfd3b98f55ee37c22590cd198e61bfc83638c45292c7842984985e543cfb345b5f565e1e62165d31b8068a2e06881c16aa9
|
|
@@ -175,6 +175,6 @@ Feature: Generating SVG clowncars during preview mode
|
|
|
175
175
|
And the file "testfile.html" should contain "@media%20screen%20and%20(max-width:200px)%7Bsvg%7Bbackground-image:url(http://localhost:4567/photos/test-image/test-image-small.jpg);%7D%7D"
|
|
176
176
|
And the file "testfile.html" should contain "@media%20screen%20and%20(min-width:201px)%20and%20(max-width:400px)%7Bsvg%7Bbackground-image:url(http://localhost:4567/photos/test-image/test-image-medium.jpg);%7D%7D"
|
|
177
177
|
And the file "testfile.html" should contain "@media%20screen%20and%20(min-width:401px)%20and%20(max-width:600px)%7Bsvg%7Bbackground-image:url(http://localhost:4567/photos/test-image/test-image-large.jpg);%7D%7D"
|
|
178
|
-
And the file "testfile.html" should contain "@media%20screen%20and%20(min-width:601px)%7Bsvg%7Bbackground-image:url(/photos/test-image/../test-image.jpg);%7D%7D"
|
|
178
|
+
And the file "testfile.html" should contain "@media%20screen%20and%20(min-width:601px)%7Bsvg%7Bbackground-image:url(http://localhost:4567/photos/test-image/../test-image.jpg);%7D%7D"
|
|
179
179
|
|
|
180
180
|
|
|
@@ -75,7 +75,6 @@ module Middleman
|
|
|
75
75
|
if uri.host
|
|
76
76
|
path
|
|
77
77
|
else
|
|
78
|
-
|
|
79
78
|
svg_path = File.join(File.dirname(name),File.basename(name,".*"), path)
|
|
80
79
|
|
|
81
80
|
if is_relative
|
|
@@ -158,8 +157,6 @@ module Middleman
|
|
|
158
157
|
|
|
159
158
|
|
|
160
159
|
def generate_svg(name, is_relative, options)
|
|
161
|
-
#puts "name for generate_svg = #{name}"
|
|
162
|
-
#puts "options for generate_svg = #{options}"
|
|
163
160
|
sizes, width, height = get_image_sizes(name, options)
|
|
164
161
|
|
|
165
162
|
fallback_host = false
|
|
@@ -168,8 +165,10 @@ module Middleman
|
|
|
168
165
|
if is_relative_url?(test_path)
|
|
169
166
|
if options.has_key?(:host)
|
|
170
167
|
fallback_host = options[:host]
|
|
171
|
-
elsif app.config[:asset_host]
|
|
168
|
+
elsif app.config[:asset_host] # this is for middleman 2 & 3, (and maybe early 4?)
|
|
172
169
|
fallback_host = app.config[:asset_host]
|
|
170
|
+
elsif app.extensions[:asset_host] # this is for middleman 4+
|
|
171
|
+
fallback_host = app.extensions[:asset_host].options.host
|
|
173
172
|
else
|
|
174
173
|
warn "WARNING: Inline clowncar images require absolute paths. Please set a :host value"
|
|
175
174
|
end
|
|
@@ -236,8 +235,6 @@ module Middleman
|
|
|
236
235
|
%Q{<object type="image/svg+xml" style="#{object_style}" data-aspect-ratio="#{width.to_f/height.to_f}" data="#{url}">#{internal}</object>}
|
|
237
236
|
else
|
|
238
237
|
data = extensions[:automatic_clowncar].generate_svg(name, true, options)
|
|
239
|
-
puts "data ==============="
|
|
240
|
-
puts data
|
|
241
238
|
%Q{<object type="image/svg+xml" style="#{object_style}" data-aspect-ratio="#{width.to_f/height.to_f}" data="data:image/svg+xml,#{automatic_clowncar_escape(data)}">#{internal}</object>}
|
|
242
239
|
end
|
|
243
240
|
end
|