smo_metadata.html 1.3 KB

123456789101112131415161718192021222324252627
  1. {% macro smo_metadata(article) %}
  2. <meta property="og:title" content="{{ article.title|striptags|e }} {%if article.subtitle %} - {{ article.subtitle|striptags|e }} {% endif %}"/>
  3. <meta property="og:url" content="{{ SITEURL }}/{{ article.url }}" />
  4. <meta property="og:description" content="{{article.summary|striptags|e}}" />
  5. <meta property="og:site_name" content="{{ SITENAME|striptags|e }}" />
  6. <meta property="og:article:author" content="{{ article.author }}" />
  7. {% if article.date %}
  8. <meta property="og:article:published_time" content="{{ article.date.isoformat() }}" />
  9. {% endif %}
  10. {% if article.locale_modified and article.modified %}
  11. <meta property="" content="{{ article.modified.isoformat() }}" />
  12. {% endif %}
  13. <meta name="twitter:title" content="{{ article.title|striptags|e }} {%if article.subtitle %} - {{ article.subtitle|striptags|e }} {% endif %}">
  14. <meta name="twitter:description" content="{{article.summary|striptags|e}}">
  15. {% if article.featured_image %}
  16. <meta property="og:image" content="{{article.featured_image}}" />
  17. <meta name="twitter:image" content="{{article.featured_image}}" >
  18. {% else %}
  19. {% from '_includes/_defaults.html' import FEATURED_IMAGE with context %}
  20. {% if FEATURED_IMAGE %}
  21. <meta property="og:image" content="{{FEATURED_IMAGE}}" />
  22. <meta name="twitter:image" content="{{FEATURED_IMAGE}}" >
  23. {% endif %}
  24. {% endif %}
  25. {% endmacro %}