Memoize Sitemap::Page#destination_path
This commit is contained in:
parent
fdbd301a32
commit
d483d8bc54
1 changed files with 3 additions and 2 deletions
|
@ -192,8 +192,9 @@ module Middleman::Sitemap
|
|||
# This path can be affected by proxy callbacks.
|
||||
# @return [String]
|
||||
def destination_path
|
||||
# TODO: memoize this value
|
||||
store.reroute_callbacks.inject(self.path) do |destination, callback|
|
||||
# memoizing this means that reroute callbacks should be in place before the sitemap
|
||||
# gets built
|
||||
@destination_path ||= store.reroute_callbacks.inject(self.path) do |destination, callback|
|
||||
callback.call(destination, self)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue