From 06324f0e14836bc5119db8ed9dc9edfc44eb120d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 6 Nov 2020 14:04:09 +0000 Subject: [PATCH] Add citations to blog html --- blog.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/blog.py b/blog.py index a1efa5e2..4c3e83c7 100644 --- a/blog.py +++ b/blog.py @@ -233,7 +233,28 @@ def htmlBlogPostContent(authorized: bool, 'content') blogStr += '
' + contentStr + '\n' - blogStr += '
\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 += \ + '
  • ' + \ + '' + tagJson['name'] + '
  • \n' + if citationsStr: + citationsStr = '

    ' + translate['Citations'] + \ + ':

    ' + \ + '\n' + + blogStr += '
    \n' + citationsStr if not linkedAuthor: blogStr += '