Merge pull request #1746 from maul-esel/missing-include

output including file for include tag error
This commit is contained in:
Matt Rogers 2013-11-22 20:29:11 -08:00
commit 7cb44fdff1
2 changed files with 9 additions and 7 deletions

View File

@ -87,7 +87,7 @@ module Jekyll
def render_liquid(content, payload, info, path = nil)
Liquid::Template.parse(content).render!(payload, info)
rescue Tags::IncludeTagError => e
Jekyll.logger.error "Liquid Exception:", "#{e.message} in #{e.path}"
Jekyll.logger.error "Liquid Exception:", "#{e.message} in #{e.path}, included in #{path || self.path}"
raise e
rescue Exception => e
Jekyll.logger.error "Liquid Exception:", "#{e.message} in #{path || self.path}"

View File

@ -96,14 +96,16 @@ eos
path = File.join(dir, file)
validate_file(path, context.registers[:site].safe)
partial = Liquid::Template.parse(source(path, context))
begin
partial = Liquid::Template.parse(source(path, context))
context.stack do
context['include'] = parse_params(context) if @params
partial.render!(context)
context.stack do
context['include'] = parse_params(context) if @params
partial.render!(context)
end
rescue => e
raise IncludeTagError.new e.message, File.join(INCLUDES_DIR, @file)
end
rescue => e
raise IncludeTagError.new e.message, File.join(INCLUDES_DIR, @file)
end
def validate_dir(dir, safe)