Include attachments within blog posts

main
Bob Mottram 2020-02-25 16:57:25 +00:00
parent 48e03a5225
commit 3307e978c5
1 changed files with 17 additions and 0 deletions

17
blog.py
View File

@ -18,6 +18,7 @@ from shutil import copyfileobj
from pprint import pprint from pprint import pprint
from content import replaceEmojiFromTags from content import replaceEmojiFromTags
from webinterface import getPostAttachmentsAsHtml
from webinterface import htmlHeader from webinterface import htmlHeader
from webinterface import htmlFooter from webinterface import htmlFooter
from webinterface import addEmbeddedElements from webinterface import addEmbeddedElements
@ -75,6 +76,22 @@ def htmlBlogPostContent(baseDir: str,httpPrefix: str,translate: {}, \
blogStr+=' '+handle blogStr+=' '+handle
blogStr+='</h3>\n' blogStr+='</h3>\n'
avatarLink=''
replyStr=''
announceStr=''
likeStr=''
bookmarkStr=''
deleteStr=''
muteStr=''
isMuted=False
attachmentStr,galleryStr= \
getPostAttachmentsAsHtml(postJsonObject,'tlblogs',translate, \
isMuted,avatarLink, \
replyStr,announceStr,likeStr, \
bookmarkStr,deleteStr,muteStr)
if attachmentStr:
blogStr+='<br>'+attachmentStr
if postJsonObject['object'].get('content'): if postJsonObject['object'].get('content'):
contentStr=addEmbeddedElements(translate,postJsonObject['object']['content']) contentStr=addEmbeddedElements(translate,postJsonObject['object']['content'])
if postJsonObject['object'].get('tag'): if postJsonObject['object'].get('tag'):