From 4e4532912bb09306ff290f4f23f77bdc1322fafd Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 20 Nov 2022 13:26:50 +0000 Subject: [PATCH] Dublin core metadata on individual posts --- webapp_post.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/webapp_post.py b/webapp_post.py index 7027f8905..3c04d5676 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -109,12 +109,21 @@ def _html_post_metadata_open_graph(domain: str, post_json_object: {}, """Returns html OpenGraph metadata for a post """ metadata = \ + " \n" + metadata += \ + " \n" + metadata += \ " \n" metadata += \ " \n" obj_json = post_json_object if has_object_dict(post_json_object): obj_json = post_json_object['object'] + if obj_json.get('id'): + metadata += " " if obj_json.get('attributedTo'): if isinstance(obj_json['attributedTo'], str): attrib = obj_json['attributedTo'] @@ -122,6 +131,10 @@ def _html_post_metadata_open_graph(domain: str, post_json_object: {}, if actor_nick: actor_domain, _ = get_domain_from_actor(attrib) actor_handle = actor_nick + '@' + actor_domain + metadata += \ + " \n" metadata += \ " \n" @@ -130,6 +143,9 @@ def _html_post_metadata_open_graph(domain: str, post_json_object: {}, " \n" if obj_json.get('published'): + metadata += " \n" metadata += \ " \n" @@ -2634,6 +2650,7 @@ def html_individual_post(recent_posts_cache: {}, max_recent_posts: int, system_language) header_str = html_header_with_external_style(css_filename, instance_title, metadata_str) + return header_str + post_str + html_footer()