Merge pull request #5009 from nasht00/master

Merge pull request 5009
This commit is contained in:
jekyllbot 2016-06-15 10:04:37 -07:00 committed by GitHub
commit 713fbb6652
2 changed files with 25 additions and 1 deletions

View File

@ -333,3 +333,28 @@ Feature: Hooks
Then I should get a zero exit status Then I should get a zero exit status
And the _site directory should exist And the _site directory should exist
And I should see "Wrote document 0" in "_site/document-build.log" And I should see "Wrote document 0" in "_site/document-build.log"
Scenario: Set a custom payload['page'] property
Given I have a _plugins directory
And I have a "_plugins/ext.rb" file with content:
"""
Jekyll::Hooks.register :pages, :pre_render do |page, payload|
payload['page']['foo'] = "hello world"
end
"""
And I have a _layouts directory
And I have a "_layouts/custom.html" file with content:
"""
---
---
{{ content }} {% include foo.html %}
"""
And I have a _includes directory
And I have a "_includes/foo.html" file with content:
"""
{{page.foo}}
"""
And I have an "index.html" page with layout "custom" that contains "page content"
When I run jekyll build
Then the "_site/index.html" file should exist
And I should see "page content\n hello world" in "_site/index.html"

View File

@ -141,7 +141,6 @@ module Jekyll
while layout while layout
payload['content'] = output payload['content'] = output
payload['page'] = document.to_liquid
payload['layout'] = Utils.deep_merge_hashes(layout.data, payload["layout"] || {}) payload['layout'] = Utils.deep_merge_hashes(layout.data, payload["layout"] || {})
output = render_liquid( output = render_liquid(