Handle empty frontmatter without logging an exception
This commit is contained in:
parent
f89c815868
commit
f7d1471edb
|
@ -89,12 +89,13 @@ module Middleman::CoreExtensions
|
||||||
content = content.sub(yaml_regex, "")
|
content = content.sub(yaml_regex, "")
|
||||||
|
|
||||||
begin
|
begin
|
||||||
data = YAML.load($1).symbolize_keys
|
data = YAML.load($1)
|
||||||
|
return false unless data
|
||||||
|
data.symbolize_keys
|
||||||
rescue *YAML_ERRORS => e
|
rescue *YAML_ERRORS => e
|
||||||
logger.error "YAML Exception: #{e.message}"
|
logger.error "YAML Exception: #{e.message}"
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue