1
0
Fork 0
forked from github/pelican

Bug #1493 — Memoize slugify when possible

This commit is contained in:
Alexis Métaireau 2014-10-09 11:27:53 +02:00
commit e39dc95c3b
3 changed files with 4 additions and 2 deletions

View file

@ -41,6 +41,8 @@ class URLWrapper(object):
return self.slug
def _normalize_key(self, key):
if hasattr(key, 'name'):
key = key.name
subs = self.settings.get('SLUG_SUBSTITUTIONS', ())
return six.text_type(slugify(key, subs))