forked from tanner/qotnews
fix sitemap
This commit is contained in:
parent
b759f46582
commit
abf8589e02
|
@ -108,13 +108,13 @@ class Sitemap:
|
|||
if md['type'] == 'https://schema.org/NewsArticle':
|
||||
props = md['properties']
|
||||
s['title'] = props['headline']
|
||||
if props['author']:
|
||||
if 'author' in props and props['author']:
|
||||
s['author'] = props['author']['properties']['name']
|
||||
|
||||
for ld in data['json-ld']:
|
||||
if ld['@type'] == 'Article':
|
||||
s['title'] = ld['headline']
|
||||
if ld['author']:
|
||||
if 'author' in ld and ld['author']:
|
||||
s['author'] = ld['author']['name']
|
||||
return s
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user