use regex to verify yaml existence

This commit is contained in:
Ben Balter
2014-04-11 08:00:40 -04:00
parent 6c0f40385c
commit 387cf2181a

View File

@@ -374,7 +374,7 @@ module Jekyll
end
def has_yaml_header?(file)
"---\n" == File.open(file) { |fd| fd.read(4) }
!!(File.open(file).read =~ /^---\r?\n/)
end
def limit_posts!