features/hooks: global payload _is_ global -- not new for each page

This commit is contained in:
Parker Moore 2015-12-22 21:36:15 -05:00
parent 659f0869e0
commit 30ceda52ef
1 changed files with 3 additions and 3 deletions

View File

@ -89,11 +89,11 @@ Feature: Hooks
And I have a "_plugins/ext.rb" file with content:
"""
Jekyll::Hooks.register :pages, :pre_render do |page, payload|
payload['myparam'] = 'special' if page.name == 'page1.html'
payload.page['myparam'] = 'special' if page.name == 'page1.html'
end
"""
And I have a "page1.html" page that contains "{{ myparam }}"
And I have a "page2.html" page that contains "{{ myparam }}"
And I have a "page1.html" page that contains "{{ page.myparam }}"
And I have a "page2.html" page that contains "{{ page.myparam }}"
When I run jekyll build
Then I should see "special" in "_site/page1.html"
And I should not see "special" in "_site/page2.html"