Skip to content

Commit

Permalink
do a path cache
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed Jun 2, 2015
1 parent 19a9085 commit 5ef5550
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nikola/nikola.py
Expand Up @@ -1176,6 +1176,8 @@ def generic_rss_renderer(self, lang, title, link, description, timeline, output_
data = data.decode('utf-8')
rss_file.write(data)

path_cache = {}

def path(self, kind, name, lang=None, is_link=False):
"""Build the path to a certain kind of page.
Expand Down Expand Up @@ -1226,7 +1228,9 @@ def path(self, kind, name, lang=None, is_link=False):
else:
return link
else:
return os.path.join(*path)
path = os.path.join(*path)
self.path_cache[path] = (kind, name, lang)
return path
except KeyError:
utils.LOGGER.warn("Unknown path request of kind: {0}".format(kind))
return ""
Expand Down

0 comments on commit 5ef5550

Please sign in to comment.