Clean up some code per @baweaver's suggestions.
This commit is contained in:
parent
ad7efb23e6
commit
a1af95c34e
|
@ -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
|
||||
|
|
|
@ -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|
|
||||
|
|
Loading…
Reference in New Issue