chiark / gitweb /
theme: ability to disable rendering of all social meta tags.
authorVladimír Vondruš <mosra@centrum.cz>
Sat, 16 Dec 2017 17:37:08 +0000 (18:37 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Sat, 16 Dec 2017 17:37:08 +0000 (18:37 +0100)
The testing was already unbearable.

doc/pelican/theme.rst
pelican-theme/templates/base.html

index ddcc699c320a5ef8404b7ec29c85188c626d1c96..9d6037c6063c20041204fb6b83cf7aebf8c6bf04 100644 (file)
@@ -303,6 +303,9 @@ Example configuration to give sane defaults to all social meta tags:
     `Facebook Debugger <https://developers.facebook.com/tools/debug/>`_ or
     `Twitter Card Validator <https://cards-dev.twitter.com/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`_
 ========
 
index 146c9db75dcbe5a02c83048768b52ca789eb5667..513a41a7ebb3ce1de15d4f5285fa207e8dc9fc24 100644 (file)
@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html lang="{% if page and page.lang %}{{ page.lang }}{% elif article and article.lang %}{{ article.lang }}{% else %}{{ DEFAULT_LANG }}{%endif %}" prefix="og: http://ogp.me/ns#">
+<html lang="{% if page and page.lang %}{{ page.lang }}{% elif article and article.lang %}{{ article.lang }}{% else %}{{ DEFAULT_LANG }}{%endif %}"{% if not M_DISABLE_SOCIAL_META_TAGS %} prefix="og: http://ogp.me/ns#"{% endif %}>
 <head>
   <meta charset="UTF-8" />
   <title>{% block title %}{{ SITENAME|e }}{% endblock title %}</title>
@@ -20,6 +20,7 @@
   {% endif %}
   {% block meta %}
   {% endblock meta %}
+  {% if not M_DISABLE_SOCIAL_META_TAGS %}
   {% if M_SOCIAL_TWITTER_SITE %}
   <meta name="twitter:site" content="{{ M_SOCIAL_TWITTER_SITE }}" />
   {% endif %}
@@ -28,6 +29,7 @@
   {% endif %}
   {% block social %}
   {% endblock social %}
+  {% endif %}
 </head>
 <body>
 <header><nav id="navigation"{% if page and page.landing and page.cover %} class="m-navbar-landing"{% endif %}{% if article and article.cover %} class="m-navbar-jumbo"{% endif %}>