Clean up some code per @baweaver's suggestions.

This commit is contained in:
Parker Moore 2014-04-14 17:14:12 -04:00
parent ad7efb23e6
commit a1af95c34e
2 changed files with 6 additions and 8 deletions

View File

@ -60,16 +60,14 @@ module Jekyll
#
# Returns the converted content.
def convert(content)
output = content.dup
converters.each do |converter|
converters.reduce(content) do |output, converter|
begin
output = converter.convert(output)
converter.convert output
rescue => e
Jekyll.logger.error "Conversion error:", "#{converter.class} encountered an error converting '#{document.relative_path}'."
raise e
end
end
output
end
# Render the given content with the payload and info

View File

@ -395,14 +395,14 @@ module Jekyll
end
def documents
docs = Set.new
collections.each do |label, coll|
collections.reduce(Set.new) do |docs, (label, coll)|
if to_render.include?(label)
docs = docs.merge(coll.docs)
end
end
docs.merge(coll.docs)
else
docs
end
end
end
def each_site_file
%w(posts pages static_files documents).each do |type|