Fix #164, by "slugifying" titles (which for generated filename is also better imho) + a few remplacement of ".rst" by the "ext" variable.

This commit is contained in:
Nicolas Steinmetz 2011-08-30 15:11:30 +03:00
commit 67485be240

View file

@ -120,7 +120,7 @@ def dc2fields(file):
content = content.replace('\\n', '')
post_format = "html"
yield (post_title, content, post_url, post_creadt, author, categories, tags, post_format)
yield (post_title, content, slugify(post_title), post_creadt, author, categories, tags, post_format)
def feed2fields(file):
@ -175,7 +175,7 @@ def fields2pelican(fields, output_path, dircat=False):
# option to put files in directories with categories names
if dircat and (len(categories) == 1):
catname = categories[0]
out_filename = os.path.join(output_path, catname, filename+'.rst')
out_filename = os.path.join(output_path, catname, filename+ext)
if not os.path.isdir(os.path.join(output_path, catname)):
os.mkdir(os.path.join(output_path, catname))
else: