forked from github/pelican
Bug #1493 — Memoize slugify when possible
This commit is contained in:
parent
7feb638b5c
commit
e39dc95c3b
3 changed files with 4 additions and 2 deletions
|
|
@ -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))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue