Address my comments in #5052.
This commit is contained in:
parent
1c33bd5797
commit
d49c781779
|
@ -129,10 +129,10 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns String rendered page.
|
# Returns String rendered page.
|
||||||
def render(layouts, site_payload)
|
def render(layouts, site_payload)
|
||||||
self.output = _renderer.tap do |renderer|
|
site_payload["page"] = to_liquid
|
||||||
renderer.layouts = layouts
|
site_payload["paginator"] = pager.to_liquid
|
||||||
renderer.payload = site_payload
|
|
||||||
end.run
|
do_layout(site_payload, layouts)
|
||||||
end
|
end
|
||||||
|
|
||||||
# The path to the source file
|
# The path to the source file
|
||||||
|
|
|
@ -67,8 +67,7 @@ module Jekyll
|
||||||
# rubocop: disable AbcSize
|
# rubocop: disable AbcSize
|
||||||
def render_document
|
def render_document
|
||||||
info = {
|
info = {
|
||||||
:filters => [Jekyll::Filters],
|
:registers => { :site => site, :page => payload["page"] },
|
||||||
:registers => { :site => site, :page => payload["page"] }
|
|
||||||
}
|
}
|
||||||
output = document.content
|
output = document.content
|
||||||
if document.render_with_liquid?
|
if document.render_with_liquid?
|
||||||
|
@ -169,11 +168,12 @@ module Jekyll
|
||||||
# Returns nothing
|
# Returns nothing
|
||||||
private
|
private
|
||||||
def validate_layout(layout)
|
def validate_layout(layout)
|
||||||
|
return unless invalid_layout?(layout)
|
||||||
Jekyll.logger.warn(
|
Jekyll.logger.warn(
|
||||||
"Build Warning:",
|
"Build Warning:",
|
||||||
"Layout '#{document.data["layout"]}' requested "\
|
"Layout '#{document.data["layout"]}' requested "\
|
||||||
"in #{document.relative_path} does not exist."
|
"in #{document.relative_path} does not exist."
|
||||||
) if invalid_layout?(layout)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Render layout content into document.output
|
# Render layout content into document.output
|
||||||
|
@ -194,10 +194,11 @@ module Jekyll
|
||||||
|
|
||||||
private
|
private
|
||||||
def add_regenerator_dependencies(layout)
|
def add_regenerator_dependencies(layout)
|
||||||
|
return unless document.write?
|
||||||
site.regenerator.add_dependency(
|
site.regenerator.add_dependency(
|
||||||
site.in_source_dir(document.path),
|
site.in_source_dir(document.path),
|
||||||
site.in_source_dir(layout.path)
|
site.in_source_dir(layout.path)
|
||||||
) if document.write?
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Set page content to payload and assign pager if document has one.
|
# Set page content to payload and assign pager if document has one.
|
||||||
|
|
Loading…
Reference in New Issue