From df573d1c935f17c33a2095ea9b9e66adaa8fda3d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 7 Nov 2021 10:38:11 +0000 Subject: [PATCH] Add opengraph metadata to individual html posts --- blog.py | 7 +-- fitnessFunctions.py | 2 +- webapp_accesskeys.py | 3 +- webapp_calendar.py | 7 +-- webapp_column_left.py | 5 +- webapp_column_right.py | 10 ++-- webapp_confirm.py | 11 +++-- webapp_create_post.py | 2 +- webapp_frontscreen.py | 2 +- webapp_hashtagswarm.py | 2 +- webapp_moderation.py | 4 +- webapp_person_options.py | 2 +- webapp_post.py | 96 +++++++++++++++++++++++++++++++++++++-- webapp_profile.py | 5 +- webapp_search.py | 15 +++--- webapp_suspended.py | 3 +- webapp_timeline.py | 2 +- webapp_tos.py | 2 +- webapp_utils.py | 28 +++++++----- webapp_welcome.py | 2 +- webapp_welcome_final.py | 2 +- webapp_welcome_profile.py | 2 +- 22 files changed, 159 insertions(+), 55 deletions(-) diff --git a/blog.py b/blog.py index d273f1c4c..0666e8677 100644 --- a/blog.py +++ b/blog.py @@ -487,7 +487,7 @@ def htmlBlogPage(authorized: bool, session, cssFilename = baseDir + '/epicyon.css' instanceTitle = \ getConfigParam(baseDir, 'instanceTitle') - blogStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle) + blogStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) _htmlBlogRemoveCwButton(blogStr, translate) blogsIndex = acctDir(baseDir, nickname, domain) + '/tlblogs.index' @@ -707,7 +707,7 @@ def htmlBlogView(authorized: bool, cssFilename = baseDir + '/epicyon.css' instanceTitle = \ getConfigParam(baseDir, 'instanceTitle') - blogStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle) + blogStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) if _noOfBlogAccounts(baseDir) <= 1: nickname = _singleBlogAccountNickname(baseDir) @@ -810,7 +810,8 @@ def htmlEditBlog(mediaInstance: bool, translate: {}, instanceTitle = \ getConfigParam(baseDir, 'instanceTitle') - editBlogForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle) + editBlogForm = \ + htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) editBlogForm += \ '
\n' + \ 'Watchpoints for ' + fitnessId + '\n' + \ diff --git a/webapp_accesskeys.py b/webapp_accesskeys.py index ebf26dae8..d118bd70a 100644 --- a/webapp_accesskeys.py +++ b/webapp_accesskeys.py @@ -60,7 +60,8 @@ def htmlAccessKeys(cssCache: {}, baseDir: str, instanceTitle = \ getConfigParam(baseDir, 'instanceTitle') - accessKeysForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle) + accessKeysForm = \ + htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) accessKeysForm += '
\n' accessKeysForm += \ diff --git a/webapp_calendar.py b/webapp_calendar.py index 2fc19edfa..7e7fe2a1e 100644 --- a/webapp_calendar.py +++ b/webapp_calendar.py @@ -58,7 +58,8 @@ def htmlCalendarDeleteConfirm(cssCache: {}, translate: {}, baseDir: str, instanceTitle = \ getConfigParam(baseDir, 'instanceTitle') - deletePostStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle) + deletePostStr = \ + htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) deletePostStr += \ '

' + postTime + ' ' + str(year) + '/' + \ str(monthNumber) + \ @@ -120,7 +121,7 @@ def _htmlCalendarDay(personCache: {}, cssCache: {}, translate: {}, calActor = '/users/' + actor.split('/users/')[1] instanceTitle = getConfigParam(baseDir, 'instanceTitle') - calendarStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle) + calendarStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) calendarStr += '
\n' calendarStr += '
\n' calendarStr += \ @@ -340,7 +341,7 @@ def htmlCalendar(personCache: {}, cssCache: {}, translate: {}, instanceTitle = \ getConfigParam(baseDir, 'instanceTitle') - headerStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle) + headerStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) # the main graphical calendar as a table calendarStr = '
\n' diff --git a/webapp_column_left.py b/webapp_column_left.py index 7ffdd4636..44382a1d8 100644 --- a/webapp_column_left.py +++ b/webapp_column_left.py @@ -364,7 +364,7 @@ def htmlLinksMobile(cssCache: {}, baseDir: str, instanceTitle = \ getConfigParam(baseDir, 'instanceTitle') - htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle) + htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) bannerFile, bannerFilename = \ getBannerFile(baseDir, nickname, domain, theme) htmlStr += \ @@ -430,7 +430,8 @@ def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str, instanceTitle = \ getConfigParam(baseDir, 'instanceTitle') - editLinksForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle) + editLinksForm = \ + htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) # top banner editLinksForm += \ diff --git a/webapp_column_right.py b/webapp_column_right.py index fe0b03cac..93febdfb5 100644 --- a/webapp_column_right.py +++ b/webapp_column_right.py @@ -361,7 +361,7 @@ def htmlCitations(baseDir: str, nickname: str, domain: str, instanceTitle = \ getConfigParam(baseDir, 'instanceTitle') - htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle) + htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) # top banner bannerFile, bannerFilename = \ @@ -476,7 +476,7 @@ def htmlNewswireMobile(cssCache: {}, baseDir: str, nickname: str, instanceTitle = \ getConfigParam(baseDir, 'instanceTitle') - htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle) + htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) bannerFile, bannerFilename = \ getBannerFile(baseDir, nickname, domain, theme) @@ -545,7 +545,8 @@ def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str, instanceTitle = \ getConfigParam(baseDir, 'instanceTitle') - editNewswireForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle) + editNewswireForm = \ + htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) # top banner editNewswireForm += \ @@ -667,7 +668,8 @@ def htmlEditNewsPost(cssCache: {}, translate: {}, baseDir: str, path: str, instanceTitle = \ getConfigParam(baseDir, 'instanceTitle') - editNewsPostForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle) + editNewsPostForm = \ + htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) editNewsPostForm += \ '\n' diff --git a/webapp_confirm.py b/webapp_confirm.py index 0d56fa1ac..b5972d082 100644 --- a/webapp_confirm.py +++ b/webapp_confirm.py @@ -62,7 +62,8 @@ def htmlConfirmDelete(cssCache: {}, instanceTitle = \ getConfigParam(baseDir, 'instanceTitle') - deletePostStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle) + deletePostStr = \ + htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) deletePostStr += \ individualPostAsHtml(signingPrivateKeyPem, True, recentPostsCache, maxRecentPosts, @@ -137,7 +138,7 @@ def htmlConfirmRemoveSharedItem(cssCache: {}, translate: {}, baseDir: str, cssFilename = baseDir + '/follow.css' instanceTitle = getConfigParam(baseDir, 'instanceTitle') - sharesStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle) + sharesStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) sharesStr += '