Просмотр исходного кода

Move og:type and twitter:card into base.html because it is repeated without any change in every file

Talha Mansoor лет назад: 10
Родитель
Сommit
257332b134

+ 0 - 2
templates/_includes/smo_metadata.html

@@ -1,6 +1,5 @@
 {% macro smo_metadata(article) %}
 <meta property="og:title" content="{{ article.title|striptags|e }} {%if article.subtitle %} - {{ article.subtitle|striptags|e }} {% endif %}"/>
-<meta property="og:type" content="article" />
 <meta property="og:url" content="{{ SITEURL }}/{{ article.url }}" />
 <meta property="og:description" content="{{article.summary|striptags|e}}" />
 <meta property="og:site_name" content="{{ SITENAME|striptags|e }}" />
@@ -11,7 +10,6 @@
 {% if article.locale_modified and article.modified %}
 <meta property="" content="{{ article.modified.isoformat() }}" />
 {% endif %}
-<meta name="twitter:card" content="summary">
 <meta name="twitter:title" content="{{ article.title|striptags|e }} {%if article.subtitle %} - {{ article.subtitle|striptags|e }} {% endif %}">
 <meta name="twitter:description" content="{{article.summary|striptags|e}}">
 {% if article.featured_image %}

+ 0 - 2
templates/archives.html

@@ -12,13 +12,11 @@ Full archives of {{ SITENAME|striptags|e }} blog.
 {{ super() }}
 <meta property="og:title" content="All Posts · {{ SITENAME|striptags|e }}"/>
 <meta name="twitter:title" content="All Posts · {{ SITENAME|striptags|e }}">
-<meta property="og:type" content="article" />
 <meta property="og:url" content="{{ SITEURL }}/archives.html" />
 <meta property="og:description" content="Full archives of {{ SITENAME|striptags|e }} blog" />
 <meta name="twitter:description" content="Full archives of {{ SITENAME|striptags|e }} blog">
 <meta property="og:site_name" content="{{ SITENAME|striptags|e }}" />
 <meta property="og:article:author" content="{{ AUTHOR }}" />
-<meta name="twitter:card" content="summary">
 {% from '_includes/_defaults.html' import FEATURED_IMAGE with context %}
 {% if FEATURED_IMAGE %}
 <meta property="og:image" content="{{FEATURED_IMAGE}}" />

+ 2 - 0
templates/base.html

@@ -28,6 +28,8 @@
         {%if TWITTER_USERNAME %}
         <meta name="twitter:creator" content="@{{TWITTER_USERNAME}}">
         {% endif %}
+        <meta property="og:type" content="article" />
+        <meta name="twitter:card" content="summary">
         {% endblock meta_tags_in_head %}
         <title>{% block title %}{{ SITENAME|striptags|e }}{% endblock title %}</title>
         {% block head_links %}

+ 0 - 2
templates/index.html

@@ -14,7 +14,6 @@
 <meta property="og:title" content="{{ SITENAME|striptags|e }}"/>
 <meta name="twitter:title" content="{{ SITENAME|striptags|e }}">
 {% endif %}
-<meta property="og:type" content="article" />
 <meta property="og:url" content="{{ SITEURL }}" />
 {% from '_includes/_defaults.html' import SITE_DESCRIPTION with context %}
 {% if SITE_DESCRIPTION %}
@@ -23,7 +22,6 @@
 {% endif %}
 <meta property="og:site_name" content="{{ SITENAME|striptags|e }}" />
 <meta property="og:article:author" content="{{ AUTHOR }}" />
-<meta name="twitter:card" content="summary">
 {% from '_includes/_defaults.html' import FEATURED_IMAGE with context %}
 {% if FEATURED_IMAGE %}
 <meta property="og:image" content="{{FEATURED_IMAGE}}" />

+ 0 - 2
templates/tags.html

@@ -12,13 +12,11 @@ All tags used in the {{ SITENAME|striptags|e }} blog.
 {{ super() }}
 <meta property="og:title" content="All Tags · {{ SITENAME|striptags|e }}"/>
 <meta name="twitter:title" content="All Tags · {{ SITENAME|striptags|e }}">
-<meta property="og:type" content="article" />
 <meta property="og:url" content="{{ SITEURL }}/tags.html" />
 <meta property="og:description" content="All tags used in the {{ SITENAME|striptags|e }} blog" />
 <meta name="twitter:description" content="All tags used in the {{ SITENAME|striptags|e }} blog">
 <meta property="og:site_name" content="{{ SITENAME|striptags|e }}" />
 <meta property="og:article:author" content="{{ AUTHOR }}" />
-<meta name="twitter:card" content="summary">
 {% from '_includes/_defaults.html' import FEATURED_IMAGE with context %}
 {% if FEATURED_IMAGE %}
 <meta property="og:image" content="{{FEATURED_IMAGE}}" />