mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Add the ability to read from markdown too.
This commit is contained in:
parent
5322f408fd
commit
c83d234773
6 changed files with 40 additions and 20 deletions
|
|
@ -1,3 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
from datetime import datetime
|
||||
from codecs import open as _open
|
||||
|
|
@ -41,8 +42,9 @@ def slugify(value):
|
|||
|
||||
Took from django sources.
|
||||
"""
|
||||
import unicodedata
|
||||
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore')
|
||||
if type(value) == unicode:
|
||||
import unicodedata
|
||||
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore')
|
||||
value = unicode(re.sub('[^\w\s-]', '', value).strip().lower())
|
||||
return re.sub('[-\s]+', '-', value)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue