Stash documents `write?` attribute in a variable (#8389)

Merge pull request 8389
This commit is contained in:
Ashwin Maroli 2020-09-14 19:07:56 +05:30 committed by GitHub
parent c9ab616ace
commit bd04997fee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -352,7 +352,9 @@ module Jekyll
# method returns true, and if the site's Publisher will publish the document.
# False otherwise.
def write?
collection&.write? && site.publisher.publish?(self)
return @write_p if defined?(@write_p)
@write_p = collection&.write? && site.publisher.publish?(self)
end
# The Document excerpt_separator, from the YAML Front-Matter or site