Browse Source

Add new meta data series_title to use with multipart plugin

Close #95
Talha Mansoor 11 years ago
parent
commit
3686116ce5
2 changed files with 15 additions and 1 deletions
  1. 7 0
      templates/_includes/_defaults.html
  2. 8 1
      templates/_includes/multi_parts.html

+ 7 - 0
templates/_includes/_defaults.html

@@ -54,6 +54,13 @@
 {% set COMMENTS_INTRO = COMMENTS_INTRO %}
 {% endif %}
 
+{# Label to show with multi-part plugin widget #}
+{% if not SERIES_TITLE %}
+{% set SERIES_TITLE = 'Series' %}
+{% else %}
+{% set SERIES_TITLE = SERIES_TITLE %}
+{% endif %}
+
 {# Author's twitter handle. Used in Twitter card meta data #}
 {% if not TWITTER_USERNAME %}
 {% set TWITTER_USERNAME = '' %}

+ 8 - 1
templates/_includes/multi_parts.html

@@ -1,5 +1,12 @@
 {% if article.metadata.parts_articles %}
-<h4>Series</h4>
+    {% if article.series_title %}
+        <h4>{{ article.series_title }}</h4>
+    {% else %}
+        {% from '_includes/_defaults.html' import SERIES_TITLE with context %}
+        {%if SERIES_TITLE %}
+            <h4>{{ SERIES_TITLE }}</h4>
+        {% endif %}
+    {% endif %}
     <ul class="multi-parts-list">
         {% for part_article in article.metadata.parts_articles %}
             <li {% if part_article == article %}class="active-part"{% endif %}>