parent
becdcb5164
commit
ecd04badf0
|
@ -12,6 +12,15 @@ Feature: Rendering
|
|||
Then I should get a non-zero exit-status
|
||||
And I should see "Liquid Exception" in the build output
|
||||
|
||||
Scenario: When receiving bad Liquid in included file
|
||||
Given I have a _includes directory
|
||||
And I have a "_includes/invalid.html" file that contains "{% INVALID %}"
|
||||
And I have a "index.html" page with layout "simple" that contains "{% include invalid.html %}"
|
||||
And I have a simple layout that contains "{{ content }}"
|
||||
When I run jekyll build
|
||||
Then I should get a non-zero exit-status
|
||||
And I should see "Liquid Exception.*Unknown tag 'INVALID' in.*_includes/invalid\.html" in the build output
|
||||
|
||||
Scenario: Render Liquid and place in layout
|
||||
Given I have a "index.html" page with layout "simple" that contains "Hi there, Jekyll {{ jekyll.environment }}!"
|
||||
And I have a simple layout that contains "{{ content }}Ahoy, indeed!"
|
||||
|
|
|
@ -155,10 +155,14 @@ eos
|
|||
if cached_partial.key?(path)
|
||||
cached_partial[path]
|
||||
else
|
||||
cached_partial[path] = context.registers[:site]
|
||||
unparsed_file = context.registers[:site]
|
||||
.liquid_renderer
|
||||
.file(path)
|
||||
.parse(read_file(path, context))
|
||||
begin
|
||||
cached_partial[path] = unparsed_file.parse(read_file(path, context))
|
||||
rescue Liquid::SyntaxError => ex
|
||||
raise IncludeTagError.new(ex.message, path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue