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.
|
# Returns the converted content.
|
||||||
def convert(content)
|
def convert(content)
|
||||||
output = content.dup
|
converters.reduce(content) do |output, converter|
|
||||||
converters.each do |converter|
|
|
||||||
begin
|
begin
|
||||||
output = converter.convert(output)
|
converter.convert output
|
||||||
rescue => e
|
rescue => e
|
||||||
Jekyll.logger.error "Conversion error:", "#{converter.class} encountered an error converting '#{document.relative_path}'."
|
Jekyll.logger.error "Conversion error:", "#{converter.class} encountered an error converting '#{document.relative_path}'."
|
||||||
raise e
|
raise e
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
output
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Render the given content with the payload and info
|
# Render the given content with the payload and info
|
||||||
|
|
|
@ -395,13 +395,13 @@ module Jekyll
|
||||||
end
|
end
|
||||||
|
|
||||||
def documents
|
def documents
|
||||||
docs = Set.new
|
collections.reduce(Set.new) do |docs, (label, coll)|
|
||||||
collections.each do |label, coll|
|
|
||||||
if to_render.include?(label)
|
if to_render.include?(label)
|
||||||
docs = docs.merge(coll.docs)
|
docs.merge(coll.docs)
|
||||||
|
else
|
||||||
|
docs
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
docs
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def each_site_file
|
def each_site_file
|
||||||
|
|
Loading…
Reference in New Issue