Skip to content

Commit

Permalink
Memoize Site#site_data (jekyll#6809)
Browse files Browse the repository at this point in the history
Merge pull request 6809
  • Loading branch information
ashmaroli authored and jekyllbot committed Mar 14, 2018
1 parent 6a7a393 commit 55d64c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/jekyll/site.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def reset
self.pages = []
self.static_files = []
self.data = {}
@site_data = nil
@collections = nil
@docs_to_write = nil
@regenerator.clear_cache
Expand Down Expand Up @@ -254,7 +255,7 @@ def categories
#
# Returns the Hash to be hooked to site.data.
def site_data
config["data"] || data
@site_data ||= (config["data"] || data)
end

# The Hash payload containing site-wide data.
Expand Down

0 comments on commit 55d64c7

Please sign in to comment.