Friendlier error message when a non-default layout is not in the layouts directory.
This commit is contained in:
parent
a5a2e1568b
commit
89afc86a5b
|
@ -115,9 +115,13 @@ module Middleman
|
||||||
# handles cases like `style.css.sass.erb`
|
# handles cases like `style.css.sass.erb`
|
||||||
content = nil
|
content = nil
|
||||||
while ::Tilt[path]
|
while ::Tilt[path]
|
||||||
|
begin
|
||||||
opts[:template_body] = content if content
|
opts[:template_body] = content if content
|
||||||
content = render_individual_file(path, locs, opts, context)
|
content = render_individual_file(path, locs, opts, context)
|
||||||
path = File.basename(path, File.extname(path))
|
path = File.basename(path, File.extname(path))
|
||||||
|
rescue LocalJumpError => e
|
||||||
|
raise "Tried to render a layout (calls yield) at #{path} like it was a template. Non-default layouts need to be in #{source}/layouts."
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Certain output file types don't use layouts
|
# Certain output file types don't use layouts
|
||||||
|
|
Loading…
Reference in a new issue