don't try to parse frontmatter from binary files, duh

This commit is contained in:
Thomas Reynolds 2011-11-10 15:35:53 -08:00
parent d018511606
commit 610509b373
2 changed files with 4 additions and 2 deletions

View file

@ -66,7 +66,7 @@ module Middleman::CoreExtensions::FrontMatter
next if file.match(/\/\./) ||
(file.match(/\/_/) && !file.match(/\/__/)) ||
File.directory?(file)
touch_file(file)
end
end
@ -76,6 +76,9 @@ module Middleman::CoreExtensions::FrontMatter
end
def touch_file(file)
extension = File.extname(file).sub(/\./, "")
return unless ::Tilt.mappings.has_key?(extension)
content = File.read(file)
file = file.sub(@source, "")
result = parse_front_matter(content)

View file

@ -23,7 +23,6 @@ module Middleman
options_hash << ", :#{k} => '#{v}'"
end
$stderr.puts options_hash.inspect
guardfile_contents = %Q{
guard 'middleman'#{options_hash} do
watch(%r{(.*)})