Update lib/jekyll/convertible.rb

This commit is contained in:
jpravetz 2011-12-04 08:37:42 -08:00
parent 1da88bb30a
commit 9a3429dc74
1 changed files with 5 additions and 6 deletions

View File

@ -26,15 +26,14 @@ module Jekyll
def read_yaml(base, name)
self.content = File.read(File.join(base, name))
begin
if self.content =~ /^(---\s*\n.*?\n?)^(---\s*$\n?)/m
self.content = $POSTMATCH
begin
self.data = YAML.load($1)
end
rescue => e
puts "YAML Exception reading #{name}: #{e.message}"
end
end
self.data ||= {}
end