Apply typogrify on the title.

As it is done when reading the file, we need to remove html tags for the
permalink and the slug (this is done here for the notmyidea and simple themes).

While modifying the themes I also replaced the `pagename` template tag with
`article.url` (`pagename` was an empty variable, no more used ?).
This commit is contained in:
Simon 2012-05-07 12:26:17 +02:00
commit 4a0d4461e1
4 changed files with 53 additions and 42 deletions

View file

@ -8,6 +8,7 @@ import logging
from codecs import open as _open
from datetime import datetime
from itertools import groupby
from jinja2 import Markup
from operator import attrgetter
logger = logging.getLogger(__name__)
@ -44,6 +45,7 @@ def slugify(value):
Took from django sources.
"""
value = Markup(value).striptags()
if type(value) == unicode:
import unicodedata
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore')