From: Vladimír Vondruš Date: Sat, 16 Dec 2017 17:37:08 +0000 (+0100) Subject: theme: ability to disable rendering of all social meta tags. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=9d979fa6d1ce14b4be897158ed0567663c669fdd;p=blog.git theme: ability to disable rendering of all social meta tags. The testing was already unbearable. --- diff --git a/doc/pelican/theme.rst b/doc/pelican/theme.rst index ddcc699c..9d6037c6 100644 --- a/doc/pelican/theme.rst +++ b/doc/pelican/theme.rst @@ -303,6 +303,9 @@ Example configuration to give sane defaults to all social meta tags: `Facebook Debugger `_ or `Twitter Card Validator `_. +It's possible to disable rendering of all social meta tags (for example for +testing purposes) by setting :py:`M_DISABLE_SOCIAL_META_TAGS` to :py:`True`. + `Pages`_ ======== diff --git a/pelican-theme/templates/base.html b/pelican-theme/templates/base.html index 146c9db7..513a41a7 100644 --- a/pelican-theme/templates/base.html +++ b/pelican-theme/templates/base.html @@ -1,5 +1,5 @@ - + {% block title %}{{ SITENAME|e }}{% endblock title %} @@ -20,6 +20,7 @@ {% endif %} {% block meta %} {% endblock meta %} + {% if not M_DISABLE_SOCIAL_META_TAGS %} {% if M_SOCIAL_TWITTER_SITE %} {% endif %} @@ -28,6 +29,7 @@ {% endif %} {% block social %} {% endblock social %} + {% endif %}