Give a build warning if a layout does not exist

Throw a warning if a non-"none" layout is specified but the corresponding
layout file does not exist.
This commit is contained in:
Alfred Xing 2014-07-20 09:17:19 -07:00
parent c8b22a19ad
commit ac744a6313
1 changed files with 5 additions and 0 deletions

View File

@ -163,6 +163,11 @@ module Jekyll
def render_all_layouts(layouts, payload, info)
# recursively render layouts
layout = layouts[data["layout"]]
if !data["layout"].nil? && data["layout"] != "none" && layout.nil?
Jekyll.logger.warn("Build Warning:", "Layout #{data["layout"]} does not exist.")
end
used = Set.new([layout])
while layout