Cache the list of documents to be written (#6741)

Merge pull request 6741
This commit is contained in:
ashmaroli 2018-02-18 13:46:09 +05:30 committed by jekyllbot
parent 63046dbbf5
commit 64706465de
1 changed files with 2 additions and 1 deletions

View File

@ -94,6 +94,7 @@ module Jekyll
self.static_files = [] self.static_files = []
self.data = {} self.data = {}
@collections = nil @collections = nil
@docs_to_write = nil
@regenerator.clear_cache @regenerator.clear_cache
@liquid_renderer.reset @liquid_renderer.reset
@ -311,7 +312,7 @@ module Jekyll
# #
# Returns an Array of Documents which should be written # Returns an Array of Documents which should be written
def docs_to_write def docs_to_write
documents.select(&:write?) @docs_to_write ||= documents.select(&:write?)
end end
# Get all the documents # Get all the documents