Merge pull request #5767 from Crunch09/issue-5756
Merge pull request 5767
This commit is contained in:
commit
6c4699bd54
|
@ -12,6 +12,15 @@ Feature: Rendering
|
||||||
Then I should get a non-zero exit-status
|
Then I should get a non-zero exit-status
|
||||||
And I should see "Liquid Exception" in the build output
|
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
|
Scenario: Render Liquid and place in layout
|
||||||
Given I have a "index.html" page with layout "simple" that contains "Hi there, Jekyll {{ jekyll.environment }}!"
|
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!"
|
And I have a simple layout that contains "{{ content }}Ahoy, indeed!"
|
||||||
|
|
|
@ -155,10 +155,14 @@ eos
|
||||||
if cached_partial.key?(path)
|
if cached_partial.key?(path)
|
||||||
cached_partial[path]
|
cached_partial[path]
|
||||||
else
|
else
|
||||||
cached_partial[path] = context.registers[:site]
|
unparsed_file = context.registers[:site]
|
||||||
.liquid_renderer
|
.liquid_renderer
|
||||||
.file(path)
|
.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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue