mirror of https://gitlab.com/bashrc2/epicyon
Attaching citations to a blog as tags
parent
fbebbdc3d2
commit
3f53b06517
21
posts.py
21
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
|
||||
|
||||
|
||||
|
|
|
@ -5912,6 +5912,8 @@ def htmlCitations(baseDir: str, nickname: str, domain: str,
|
|||
translate['Submit'] + '">\n'
|
||||
htmlStr += ' </center>\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', '<br>')
|
||||
link = item[1]
|
||||
|
||||
citationValue = \
|
||||
dateStr + citationsSeparator + \
|
||||
title + citationsSeparator + \
|
||||
link
|
||||
htmlStr += \
|
||||
'<input type="checkbox" name="newswire' + str(ctr) + \
|
||||
'" value="' + dateStr + '"/>' + \
|
||||
'" value="' + citationValue + '"/>' + \
|
||||
'<a href="' + link + '">' + title + '</a> '
|
||||
htmlStr += '<span class="newswireDate">' + \
|
||||
dateShown + '</span><br>\n'
|
||||
|
|
Loading…
Reference in New Issue