Browse Source

Move SITE_DESCRIPTION to _defaults

Talha Mansoor 11 years ago
parent
commit
dff085b400
3 changed files with 10 additions and 0 deletions
  1. 8 0
      templates/_includes/_defaults.html
  2. 1 0
      templates/base.html
  3. 1 0
      templates/index.html

+ 8 - 0
templates/_includes/_defaults.html

@@ -83,3 +83,11 @@ serves as the default image for posts whose social_media_image is not set. #}
 {% set SITE_LICENSE = SITE_LICENSE %}
 {% endif %}
 
+{# Description of your site. It is used in meta tags so it will appear in
+search results and social media #}
+{% if not SITE_DESCRIPTION %}
+{% set SITE_DESCRIPTION = '' %}
+{% else %}
+{% set SITE_DESCRIPTION = SITE_DESCRIPTION %}
+{% endif %}
+

+ 1 - 0
templates/base.html

@@ -16,6 +16,7 @@
         {% endif %}
         {% include '_includes/latex.html' %}
 
+        {% from '_includes/_defaults.html' import SITE_DESCRIPTION with context %}
         {% if SITE_DESCRIPTION %}
         <meta name="description" content="{% block head_description %}{{ SITE_DESCRIPTION }}{% endblock head_description %}" />
         {% endif %}

+ 1 - 0
templates/index.html

@@ -15,6 +15,7 @@
 {% 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 %}
 <meta property="og:description" content="{{SITE_DESCRIPTION}}" />
 <meta name="twitter:description" content="{{SITE_DESCRIPTION}}">