middleman 0.9.22 → 0.9.23
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.
- data/VERSION +1 -1
- data/lib/middleman/features/automatic_image_sizes.rb +4 -4
- data/middleman.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.23
|
@@ -3,13 +3,13 @@ require "middleman/fastimage"
|
|
3
3
|
class Middleman::Base
|
4
4
|
alias_method :pre_automatic_image_tag, :image_tag
|
5
5
|
helpers do
|
6
|
-
def image_tag(path, params={})
|
6
|
+
def image_tag(path, params={})
|
7
7
|
if (!params[:width] || !params[:height]) && !path.include?("://")
|
8
8
|
params[:alt] ||= ""
|
9
|
-
|
9
|
+
http_prefix = options.http_images_path rescue options.images_dir
|
10
10
|
|
11
11
|
begin
|
12
|
-
real_path = File.join(options.public,
|
12
|
+
real_path = File.join(options.public, options.images_dir, path)
|
13
13
|
if File.exists? real_path
|
14
14
|
dimensions = Middleman::FastImage.size(real_path, :raise_on_failure => true)
|
15
15
|
params[:width] ||= dimensions[0]
|
@@ -18,7 +18,7 @@ class Middleman::Base
|
|
18
18
|
rescue
|
19
19
|
end
|
20
20
|
|
21
|
-
params = params.merge(:src => asset_url(path,
|
21
|
+
params = params.merge(:src => asset_url(path, http_prefix))
|
22
22
|
params = params.map { |k,v| %Q{#{k}="#{v}"}}.join(' ')
|
23
23
|
"<img #{params} />"
|
24
24
|
else
|
data/middleman.gemspec
CHANGED