consider a case of "site" is unavailable in Convertible

This commit is contained in:
MURAOKA Taro 2013-07-30 23:19:26 +09:00 committed by Shigeya Suzuki
parent f4c2383d3c
commit 4cb24f4b87
1 changed files with 2 additions and 1 deletions

View File

@ -28,7 +28,8 @@ module Jekyll
# Returns nothing. # Returns nothing.
def read_yaml(base, name) def read_yaml(base, name)
begin begin
self.content = File.read(File.join(base, name), self.site.file_read_opts) opts = self.site ? self.site.file_read_opts : {}
self.content = File.read(File.join(base, name), opts)
if self.content =~ /\A(---\s*\n.*?\n?)^(---\s*$\n?)/m if self.content =~ /\A(---\s*\n.*?\n?)^(---\s*$\n?)/m
self.content = $POSTMATCH self.content = $POSTMATCH