From e81f7e618e91e3e98a7d8c56ebfc794b1e951e0b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 3 Jul 2020 11:07:11 +0100 Subject: [PATCH] Remove the CW button from blog posts --- blog.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/blog.py b/blog.py index ab54ad1c..2101c8e3 100644 --- a/blog.py +++ b/blog.py @@ -316,6 +316,18 @@ def htmlBlogPostRSS3(authorized: bool, return rssStr +def htmlBlogRemoveCwButton(blogStr: str, translate: {}) -> str: + """Removes the CW button from blog posts, where the + summary field is instead used as the blog title + """ + blogStr = blogStr.replace('
', '') + blogStr = blogStr.replace('
', '') + blogStr = blogStr.replace('', '') + blogStr = blogStr.replace('', '') + blogStr = blogStr.replace(translate['SHOW MORE'], '') + return blogStr + + def htmlBlogPost(authorized: bool, baseDir: str, httpPrefix: str, translate: {}, nickname: str, domain: str, domainFull: str, @@ -330,6 +342,7 @@ def htmlBlogPost(authorized: bool, with open(cssFilename, 'r') as cssFile: blogCSS = cssFile.read() blogStr = htmlHeader(cssFilename, blogCSS) + htmlBlogRemoveCwButton(blogStr, translate) blogStr += htmlBlogPostContent(authorized, baseDir, httpPrefix, translate, @@ -376,6 +389,7 @@ def htmlBlogPage(authorized: bool, session, with open(cssFilename, 'r') as cssFile: blogCSS = cssFile.read() blogStr = htmlHeader(cssFilename, blogCSS) + htmlBlogRemoveCwButton(blogStr, translate) blogsIndex = baseDir + '/accounts/' + \ nickname + '@' + domain + '/tlblogs.index'