og_article.html 1.2 KB

1234567891011121314151617181920212223
  1. {% if OG_LOCALE %}
  2. {% set default_locale = OG_LOCALE %}
  3. {% else %}
  4. {% set default_locale = 'en_US' %}
  5. {% endif %}
  6. <meta property="og:site_name" content="{{ SITENAME }}" />
  7. <meta property="og:title" content="{{ article.title|striptags|escape }}" />
  8. <meta property="og:description" content="{{ article.summary|striptags|escape }}" />
  9. <meta property="og:locale" content="{{ article.metadata.get('og_locale', default_locale) }}" />
  10. <meta property="og:url" content="{{ SITEURL }}/{{ article.url }}" />
  11. <meta property="og:type" content="article" />
  12. <meta property="article:published_time" content="{{ article.date }}" />
  13. <meta property="article:modified_time" content="{{ article.modified }}" />
  14. <meta property="article:author" content="{{ SITEURL }}/{{ article.author.url }}">
  15. <meta property="article:section" content="{{ article.category.name }}" />
  16. {% for tag in article.tags %}
  17. <meta property="article:tag" content="{{ tag.name|escape }}" />
  18. {% endfor %}
  19. {% if 'cover' in article.metadata %}
  20. <meta property="og:image" content="{{ SITEURL }}/{{ ARTICLE_PRIMARY_PATH }}/{{ article.category|lower }}/{{ article.metadata['cover'] }}">
  21. {% else %}
  22. <meta property="og:image" content="{{ SITEURL }}/{{ SITELOGO }}">
  23. {% endif %}