From e22881be0d9afd170eae99d0700979f9b9e07b1b Mon Sep 17 00:00:00 2001 From: Deimos Date: Tue, 5 Mar 2019 13:28:16 -0700 Subject: [PATCH] Open Graph tags: use full url, add description It seems like the absolute url (without domain) is making the image not render in Twitter cards, and lack of a description is making some of the embeds look strange. We'll add a default description for now and look to override this soon. --- tildes/tildes/__init__.py | 2 ++ tildes/tildes/templates/base.jinja2 | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tildes/tildes/__init__.py b/tildes/tildes/__init__.py index 4ca9991..42026f7 100644 --- a/tildes/tildes/__init__.py +++ b/tildes/tildes/__init__.py @@ -47,6 +47,8 @@ def main(global_config: Dict[str, str], **settings: str) -> PrefixMiddleware: config.add_tween("tildes.http_method_tween_factory") config.add_tween("tildes.metrics_tween_factory") + config.add_static_view("images", "/images") + config.add_request_method(is_safe_request_method, "is_safe_method", reify=True) # Add the request.redis request method to access a redis connection. This is done in diff --git a/tildes/tildes/templates/base.jinja2 b/tildes/tildes/templates/base.jinja2 index 1844e08..6ef8f4c 100644 --- a/tildes/tildes/templates/base.jinja2 +++ b/tildes/tildes/templates/base.jinja2 @@ -11,11 +11,12 @@ - + {% block meta_og_tags %} + {% endblock %} {# Hardcoding each option isn't great, but I don't know a better method #}