mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
slugify filename to prevent SimpleHTTPServer raise "file not found" error
when import from wp xml. change "lxml" to ["lxml","xml"] for bs4 bug on Windows.
This commit is contained in:
parent
c60e0d03fb
commit
8c953b07b7
1 changed files with 2 additions and 2 deletions
|
|
@ -112,7 +112,7 @@ def get_items(xml):
|
|||
sys.exit(error)
|
||||
with open(xml, encoding='utf-8') as infile:
|
||||
xmlfile = infile.read()
|
||||
soup = BeautifulSoup(xmlfile, "lxml")
|
||||
soup = BeautifulSoup(xmlfile, ["lxml", "xml"])
|
||||
items = soup.rss.channel.findAll('item')
|
||||
return items
|
||||
|
||||
|
|
@ -167,7 +167,7 @@ def wp2fields(xml, wp_custpost=False):
|
|||
pass
|
||||
else:
|
||||
kind = post_type
|
||||
yield (title, content, filename, date, author, categories, tags,
|
||||
yield (title, content, slugify(filename), date, author, categories, tags,
|
||||
kind, "wp-html")
|
||||
|
||||
def dc2fields(file):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue