Only call #site_payload once for all collection work.
This commit is contained in:
parent
0eb2796a66
commit
2f8248a6f1
|
@ -3,11 +3,12 @@
|
|||
module Jekyll
|
||||
class Renderer
|
||||
|
||||
attr_reader :document, :site
|
||||
attr_reader :document, :site, :payload
|
||||
|
||||
def initialize(site, document)
|
||||
def initialize(site, document, payload = nil)
|
||||
@site = site
|
||||
@document = document
|
||||
@payload = payload
|
||||
end
|
||||
|
||||
# Determine which converters to use based on this document's
|
||||
|
@ -32,7 +33,7 @@ module Jekyll
|
|||
def run
|
||||
payload = Utils.deep_merge_hashes({
|
||||
"page" => document.to_liquid
|
||||
}, site.site_payload)
|
||||
}, payload || site.site_payload)
|
||||
|
||||
info = {
|
||||
filters: [Jekyll::Filters],
|
||||
|
|
|
@ -292,9 +292,10 @@ module Jekyll
|
|||
def render
|
||||
relative_permalinks_deprecation_method
|
||||
|
||||
payload = site_payload
|
||||
collections.each do |label, collection|
|
||||
collection.docs.each do |document|
|
||||
document.output = Jekyll::Renderer.new(self, document).run if document.regenerate?
|
||||
document.output = Jekyll::Renderer.new(self, document, payload).run if document.regenerate?
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
require 'helper'
|
||||
|
||||
class TestDeprecator < Test::Unit::TestCase
|
||||
def test_no_subcommand
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue