Skip to content

Commit

Permalink
Revert "Optimize Site#each_site_file (#9187)"
Browse files Browse the repository at this point in the history
This reverts commit b2891a4.
  • Loading branch information
DavidS committed Apr 29, 2023
1 parent bb954ff commit 16c9463
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/jekyll/site.rb
Expand Up @@ -360,9 +360,15 @@ def documents
end

def each_site_file
pages.each { |page| yield page }
static_files.each { |file| yield(file) if file.write? }
collections.each_value { |coll| coll.docs.each { |doc| yield(doc) if doc.write? } }
seen_files = []
%w(pages static_files_to_write docs_to_write).each do |type|
send(type).each do |item|
next if seen_files.include?(item)

yield item
seen_files << item
end
end
end

# Returns the FrontmatterDefaults or creates a new FrontmatterDefaults
Expand Down

0 comments on commit 16c9463

Please sign in to comment.