twitter_cards.html 1.1 KB

12345678910111213141516171819202122232425262728
  1. {% if TWITTER_CARDS and USE_OPEN_GRAPH %}
  2. {# Do not include duplicates tag with og ones. #}
  3. {# Twitter is able to infer them from og. #}
  4. <meta name="twitter:card" content="summary">
  5. {% if TWITTER_USERNAME %}
  6. <meta name="twitter:site" content="@{{ TWITTER_USERNAME }}">
  7. <meta name="twitter:creator" content="@{{ TWITTER_USERNAME }}">
  8. {% endif %}
  9. <meta name="twitter:domain" content="{{ SITEURL }}">
  10. {% if article %}
  11. {% if article.og_image %}
  12. <meta property="twitter:image"
  13. content="{{ SITEURL }}/{{ article.og_image }}"/>
  14. {% elif OPEN_GRAPH_IMAGE %}
  15. <meta property="twitter:image"
  16. content="{{ SITEURL }}/{{ OPEN_GRAPH_IMAGE }}"/>
  17. {% endif %}
  18. {% elif page %}
  19. {% if page.og_image %}
  20. <meta property="twitter:image"
  21. content="{{ SITEURL }}/{{ page.og_image }}"/>
  22. {% elif OPEN_GRAPH_IMAGE %}
  23. <meta property="twitter:image"
  24. content="{{ SITEURL }}/{{ OPEN_GRAPH_IMAGE }}"/>
  25. {% endif %}
  26. {% endif %}
  27. {% endif %}