don't globally replace build in output files, just the first duplicate directory

This commit is contained in:
Thomas Reynolds 2011-05-07 21:49:23 -07:00
parent 796ff20939
commit baef07f7cf

View file

@ -16,7 +16,7 @@ module Middleman
create_file destination, nil, config do
# The default render just requests the page over Rack and writes the response
request_path = destination.gsub(Middleman::Server.build_dir, "")
request_path = destination.sub(/^#{Middleman::Server.build_dir}/, "")
@@rack_test.get(request_path)
@@rack_test.last_response.body
end
@ -87,7 +87,7 @@ module Middleman
protected
def handle_directory(lookup)
lookup = File.join(lookup, '{*,.[a-z]*}')
lookup = File.join(lookup, '*')
Dir[lookup].sort.each do |file_source|
if File.directory?(file_source)