From 3307e978c51f2dbe5c67876e2d84a08be18f89a6 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 25 Feb 2020 16:57:25 +0000 Subject: [PATCH] Include attachments within blog posts --- blog.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/blog.py b/blog.py index 4c921082..af280790 100644 --- a/blog.py +++ b/blog.py @@ -18,6 +18,7 @@ from shutil import copyfileobj from pprint import pprint from content import replaceEmojiFromTags +from webinterface import getPostAttachmentsAsHtml from webinterface import htmlHeader from webinterface import htmlFooter from webinterface import addEmbeddedElements @@ -75,6 +76,22 @@ def htmlBlogPostContent(baseDir: str,httpPrefix: str,translate: {}, \ blogStr+=' '+handle blogStr+='\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+='
'+attachmentStr + if postJsonObject['object'].get('content'): contentStr=addEmbeddedElements(translate,postJsonObject['object']['content']) if postJsonObject['object'].get('tag'):