mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-30 09:18:11 -05:00
Only call #site_payload once for all collection work.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
6
test/test_deprecator.rb
Normal file
6
test/test_deprecator.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
require 'helper'
|
||||
|
||||
class TestDeprecator < Test::Unit::TestCase
|
||||
def test_no_subcommand
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user