mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
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:
parent
56749af1da
commit
67485be240
1 changed files with 2 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue