Merge branch 'master' of https://github.com/hagenburger/middleman into hagenburger-master

This commit is contained in:
Thomas Reynolds 2011-01-05 10:52:26 -08:00
commit 301cb49b7d

View file

@ -97,7 +97,7 @@ module Middleman
def self.page(url, options={}, &block) def self.page(url, options={}, &block)
url << settings.index_file if url.match(%r{/$}) url << settings.index_file if url.match(%r{/$})
options[:layout] ||= current_layout options[:layout] = current_layout if options[:layout].nil?
get(url) do get(url) do
return yield if block_given? return yield if block_given?
process_request(options) process_request(options)
@ -119,7 +119,9 @@ module Middleman
old_layout = settings.current_layout old_layout = settings.current_layout
settings.layout(options[:layout]) if !options[:layout].nil? 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) settings.layout(old_layout)
if result if result