mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
wordpress importer: fallback onto wp:post_id if wp:post_name is empty
This commit is contained in:
parent
44ef4d3eaa
commit
eeae09be5e
1 changed files with 3 additions and 0 deletions
|
|
@ -126,6 +126,9 @@ def wp2fields(xml):
|
||||||
content = item.find('encoded').string
|
content = item.find('encoded').string
|
||||||
filename = item.find('post_name').string
|
filename = item.find('post_name').string
|
||||||
|
|
||||||
|
if filename is None:
|
||||||
|
filename = item.find('post_id').string
|
||||||
|
|
||||||
raw_date = item.find('post_date').string
|
raw_date = item.find('post_date').string
|
||||||
date_object = time.strptime(raw_date, "%Y-%m-%d %H:%M:%S")
|
date_object = time.strptime(raw_date, "%Y-%m-%d %H:%M:%S")
|
||||||
date = time.strftime("%Y-%m-%d %H:%M", date_object)
|
date = time.strftime("%Y-%m-%d %H:%M", date_object)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue