Skip to content

Commit

Permalink
Simplify Jekyll::Renderer#validate_layout (#8064)
Browse files Browse the repository at this point in the history
Merge pull request 8064
  • Loading branch information
ashmaroli committed Apr 1, 2020
1 parent 46cffe8 commit 784a689
Showing 1 changed file with 4 additions and 10 deletions.
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

0 comments on commit 784a689

Please sign in to comment.