Catch Liquid template exceptions, and write out their details. Prevents silent fail of template parsing
This commit is contained in:
parent
31901ee15b
commit
0a58d78338
|
@ -63,7 +63,13 @@ module Jekyll
|
|||
# render and transform content (this becomes the final content of the object)
|
||||
payload["pygments_prefix"] = converter.pygments_prefix
|
||||
payload["pygments_suffix"] = converter.pygments_suffix
|
||||
self.content = Liquid::Template.parse(self.content).render(payload, info)
|
||||
|
||||
begin
|
||||
self.content = Liquid::Template.parse(self.content).render(payload, info)
|
||||
rescue => e
|
||||
puts "Liquid Exception: #{e.message} in #{self.data["layout"]}"
|
||||
end
|
||||
|
||||
self.transform
|
||||
|
||||
# output keeps track of what will finally be written
|
||||
|
@ -73,7 +79,12 @@ module Jekyll
|
|||
layout = layouts[self.data["layout"]]
|
||||
while layout
|
||||
payload = payload.deep_merge({"content" => self.output, "page" => layout.data})
|
||||
self.output = Liquid::Template.parse(layout.content).render(payload, info)
|
||||
|
||||
begin
|
||||
self.output = Liquid::Template.parse(layout.content).render(payload, info)
|
||||
rescue => e
|
||||
puts "Liquid Exception: #{e.message} in #{self.data["layout"]}"
|
||||
end
|
||||
|
||||
layout = layouts[layout.data["layout"]]
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue