fixed loading of layouts for js and css

This commit is contained in:
Nico Hagenburger 2011-01-01 23:00:09 +01:00
parent 741e2687c8
commit d4eb42f27f

View file

@ -97,7 +97,7 @@ module Middleman
def self.page(url, options={}, &block)
url << settings.index_file if url.match(%r{/$})
options[:layout] ||= current_layout
options[:layout] = current_layout if options[:layout].nil?
get(url) do
return yield if block_given?
process_request(options)
@ -119,7 +119,9 @@ module Middleman
old_layout = settings.current_layout
settings.layout(options[:layout]) if !options[:layout].nil?
result = render(path, :layout => settings.fetch_layout_path.to_sym)
layout = settings.fetch_layout_path.to_sym
layout = false if options[:layout] == false or path =~ /\.(css|js)$/
result = render(path, :layout => layout, :layout_engine => options[:layout_engine])
settings.layout(old_layout)
if result