forked from indymedia/epicyon
Add citations to blog html
parent
309fd923bd
commit
06324f0e14
23
blog.py
23
blog.py
|
@ -233,7 +233,28 @@ def htmlBlogPostContent(authorized: bool,
|
|||
'content')
|
||||
blogStr += '<br>' + contentStr + '\n'
|
||||
|
||||
blogStr += '<br>\n'
|
||||
citationsStr = ''
|
||||
if postJsonObject['object'].get('tag'):
|
||||
for tagJson in postJsonObject['object']['tag']:
|
||||
if not isinstance(tagJson, dict):
|
||||
continue
|
||||
if not tagJson.get('type'):
|
||||
continue
|
||||
if tagJson['type'] != 'Article':
|
||||
continue
|
||||
if not tagJson.get('name'):
|
||||
continue
|
||||
if not tagJson.get('url'):
|
||||
continue
|
||||
citationsStr += \
|
||||
'<li><a href="' + tagJson['url'] + '">' + \
|
||||
'<cite>' + tagJson['name'] + '</cite></a></li>\n'
|
||||
if citationsStr:
|
||||
citationsStr = '<p><b>' + translate['Citations'] + \
|
||||
':</b></p>' + \
|
||||
'<ul>\n' + citationsStr + '</ul>\n'
|
||||
|
||||
blogStr += '<br>\n' + citationsStr
|
||||
|
||||
if not linkedAuthor:
|
||||
blogStr += '<p class="about"><a class="about" href="' + \
|
||||
|
|
Loading…
Reference in New Issue