Browse Source

Add support for multi_parts plugin

Fix #95
Talha Mansoor 11 years ago
parent
commit
7b484dd611
3 changed files with 24 additions and 0 deletions
  1. 9 0
      static/css/elegant.css
  2. 14 0
      templates/_includes/multi_parts.html
  3. 1 0
      templates/article.html

+ 9 - 0
static/css/elegant.css

@@ -319,6 +319,15 @@ i.fa-bitbucket:hover {
 i.fa-stack-exchange:hover {
     background-color: #3A7BC8;
 }
+ul.multi-parts-list a {
+    color: black;
+}
+ul.multi-parts-list a:hover {
+    text-decoration: none;
+}
+ul.multi-parts-list li.active-part {
+    font-style: italic;
+}
 .table-of-content .toc {
     font-size: .7em;
 }

+ 14 - 0
templates/_includes/multi_parts.html

@@ -0,0 +1,14 @@
+{% if article.metadata.parts_articles %}
+<h4>Series</h4>
+    <ul class="multi-parts-list">
+        {% for part_article in article.metadata.parts_articles %}
+            <li {% if part_article == article %}class="active-part"{% endif %}>
+            {% if part_article != article %}
+            <a href='{{ SITEURL }}/{{ part_article.url }}'>Part {{loop.index}}</a>
+            {% else %}
+            Part {{loop.index}}
+            {% endif %}
+            </li>
+        {% endfor %}
+    </ul>
+{% endif %}

+ 1 - 0
templates/article.html

@@ -85,6 +85,7 @@
             <time pubdate="pubdate" datetime="{{ article.date.isoformat() }}">{{ article.date.strftime('%b') }} {{ day }} {{- article.date.strftime(', %Y') }}</time>
             {% endif %}
             {% include '_includes/last_updated.html' %}
+            {% include '_includes/multi_parts.html' %}
             {% if article.category|trim|count > 0 %}
             <h4>Category</h4>
             <a class="category-link" href="{{ SITEURL }}/categories.html#{{ category.slug }}-ref">{{ article.category }}</a>