Take a bit more care when checking if a view file exists.

This commit is contained in:
David Siegel 2011-06-23 09:32:10 -07:00
parent 621825b36c
commit fe9a5ece32

View file

@ -34,8 +34,8 @@ module Middleman::Features::DefaultHelpers
path = path.gsub(File.extname(path), ".#{asset_ext}")
path = path.gsub("/", separator)
views = Dir[File.join(self.class.views, asset_dir, "#{path}*")]
yield path if views.any?
view = File.join(self.class.views, asset_dir, path)
yield path if File.exists?(view) or Dir["#{view}.*"].any?
end
def page_classes