Merge branch 'master' of https://github.com/jpravetz/jekyll into jpravetz-master

This commit is contained in:
Tom Preston-Werner 2012-01-21 19:59:05 -08:00
commit 574e933d81
1 changed files with 5 additions and 6 deletions

View File

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