Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Jekyll::Renderer#validate_layout #8064

Merged
merged 1 commit into from Apr 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 4 additions & 10 deletions lib/jekyll/renderer.rb
Expand Up @@ -174,16 +174,10 @@ def place_in_layouts(content, payload, info)
# layout - the layout to check
# Returns nothing
def validate_layout(layout)
if invalid_layout?(layout)
Jekyll.logger.warn(
"Build Warning:",
"Layout '#{document.data["layout"]}' requested "\
"in #{document.relative_path} does not exist."
)
elsif !layout.nil?
layout_source = layout.path.start_with?(site.source) ? :site : :theme
Jekyll.logger.debug "Layout source:", layout_source
end
return unless invalid_layout?(layout)

Jekyll.logger.warn "Build Warning:", "Layout '#{document.data["layout"]}' requested " \
"in #{document.relative_path} does not exist."
end

# Render layout content into document.output
Expand Down