diff --git a/templates/base.html b/templates/base.html index 0c1e0250eb..f8a9683cfa 100644 --- a/templates/base.html +++ b/templates/base.html @@ -67,7 +67,11 @@ {# Twitter cards #} - + {% if request.GET.twittercard == 'large' %} + + {% else %} + + {% endif %} diff --git a/templates/tutorialv2/view/content_online.html b/templates/tutorialv2/view/content_online.html index 62aebaa9da..0263766d89 100644 --- a/templates/tutorialv2/view/content_online.html +++ b/templates/tutorialv2/view/content_online.html @@ -47,7 +47,11 @@ {% block meta_image %}{% spaceless %} {% if content.image %} - {{ content.image.physical|thumbnail_url:'social_network' }} + {% if request.GET.twittercard == "large" %} + {{ content.image.physical|thumbnail_url:'social_network_large' }} + {% else %}} + {{ content.image.physical|thumbnail_url:'social_network' }} + {% endif %} {% else %} {% load static %} {% if content.type == 'TUTORIAL' %} diff --git a/zds/settings/abstract_base/zds.py b/zds/settings/abstract_base/zds.py index 5b16d5d8f2..c133b28c5b 100644 --- a/zds/settings/abstract_base/zds.py +++ b/zds/settings/abstract_base/zds.py @@ -48,6 +48,7 @@ 'social_network': {'size': (144, 144), 'crop': True}, # ^^^ ^^^ -> minimum dimensions of 144x144 # https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/summary + 'social_network_large': {'size': (600, 314), 'crop': True} }, }