Add social cards support

This commit is contained in:
Dan Bader
2018-07-31 13:21:31 -07:00
parent cd912938e3
commit a550d579d6
+12
View File
@@ -15,16 +15,28 @@
{% if pagename == 'index' %}
<link rel="canonical" href="https://docs.python-guide.org/"/>
<meta property="og:url" content="https://docs.python-guide.org/">
{% elif pagename == '404' %}
{# No canonical on our 404 template. #}
{% else %}
<link rel="canonical" href="https://docs.python-guide.org/{{ pagename }}/"/>
<meta property="og:url" content="https://docs.python-guide.org/{{ pagename }}">
{% endif %}
<link rel="icon" type="image/png" href="https://media.readthedocs.org/images/favicon.png">
<meta name="google-site-verification" content="013PxE2_8KX9jdUSC5gr8QsfdxTXr1mFgmD9zplp5II" />
<meta name="twitter:card" content="summary">
<meta property="twitter:image" content="https://docs.python-guide.org/_static/python-guide-logo.png">
<meta property="og:image" content="https://docs.python-guide.org/_static/python-guide-logo.png">
<meta property="og:title" content="{{ title }}{{ titlesuffix }}">
<meta property="og:type" content="article">
{%- if metatags is defined %}
{# FIXME: For some reason the `meta` dict is always empty. Extract the desc from the `metatags` text. #}
<meta property="og:description" content="{{ metatags[15:-24] }}">
{%- endif %}
<script>window.rp_prop_id = '29182759436';</script>
<script src="https://srv.realpython.net/tag.js" async></script>