fix spaces build

This commit is contained in:
Thomas Reynolds 2011-11-19 15:06:08 -08:00
parent 8613a58896
commit b9a3a9fa6e
2 changed files with 8 additions and 9 deletions

View file

@ -216,7 +216,7 @@ class Middleman::Base
return unless self.class.execute_before_processing!(self, found_template)
context = sitemap.get_context(full_path(@original_path)) || {}
context = sitemap.get_context(full_path(@original_path.gsub("%20", " "))) || {}
@options = context.has_key?(:options) ? context[:options] : {}
@locals = context.has_key?(:locals) ? context[:locals] : {}
@ -228,7 +228,7 @@ class Middleman::Base
local_layout = if options.has_key?(:layout)
options[:layout]
elsif %w(.js .css).include?(File.extname(@request_path))
elsif %w(.js .css .txt).include?(File.extname(@request_path))
false
else
layout
@ -237,9 +237,6 @@ class Middleman::Base
if context.has_key?(:block) && context[:block]
instance_eval(&context[:block])
end
content_type mime_type(File.extname(@request_path))
res.status = 200
output = if local_layout
engine_options = respond_to?(engine.to_sym) ? send(engine.to_sym) : {}
@ -268,6 +265,8 @@ class Middleman::Base
render(path, locals)
end
content_type mime_type(File.extname(@request_path))
res.status = 200
res.write output
halt res.finish
end

View file

@ -16,7 +16,7 @@ module Middleman
request_path = destination.sub(/^#{SHARED_SERVER_INST.build_dir}/, "")
begin
# begin
destination, request_path = SHARED_SERVER_INST.reroute_builder(destination, request_path)
request_path.gsub!(/\s/, "%20")
@ -25,9 +25,9 @@ module Middleman
create_file destination, nil, config do
response.body
end if response.status == 200
rescue
say_status :error, destination, :red
end
# rescue
# say_status :error, destination, :red
# end
end
end