diff --git a/posts.py b/posts.py index ed93f04e9..4071911a4 100644 --- a/posts.py +++ b/posts.py @@ -1228,6 +1228,27 @@ def createBlogPost(baseDir: str, schedulePost, eventDate, eventTime, location) blog['object']['type'] = 'Article' + + # append citations tags, stored in a file + citationsFilename = \ + baseDir + '/accounts/' + \ + nickname + '@' + domain + '/.citations.txt' + if os.path.isfile(citationsFilename): + citationsSeparator = '#####' + with open(citationsFilename, "r") as f: + citations = f.readlines() + for line in citations: + sections = line.split(citationsSeparator) + dateStr = sections[0] + title = sections[1] + link = sections[2] + tagJson = { + "type": "Article", + "name": title + "url": link + } + blog['object']['tag'].append(tagJson) + return blog diff --git a/webinterface.py b/webinterface.py index 5844e92be..19dbe51d8 100644 --- a/webinterface.py +++ b/webinterface.py @@ -5912,6 +5912,8 @@ def htmlCitations(baseDir: str, nickname: str, domain: str, translate['Submit'] + '">\n' htmlStr += ' \n' + citationsSeparator = '#####' + # list of newswire items if newswire: ctr = 0 @@ -5923,9 +5925,13 @@ def htmlCitations(baseDir: str, nickname: str, domain: str, title = removeLongWords(item[0], 16, []).replace('\n', '
') link = item[1] + citationValue = \ + dateStr + citationsSeparator + \ + title + citationsSeparator + \ + link htmlStr += \ '' + \ + '" value="' + citationValue + '"/>' + \ '' + title + ' ' htmlStr += '' + \ dateShown + '
\n'