Browse Source

Add support for article metadata article.modified_date

Close #20
Talha Mansoor 11 years ago
parent
commit
bee5119d31
3 changed files with 11 additions and 2 deletions
  1. 1 0
      RELEASE_NOTES.md
  2. 5 1
      templates/article.html
  3. 5 1
      templates/page.html

+ 1 - 0
RELEASE_NOTES.md

@@ -8,6 +8,7 @@ Version 1.4 (under development)
 * New: `article.comments_intro` that overrides `COMMENTS_INTRO`. Now you can
   define article specific comments introduction
 * New: Support for Latex with the help of `latex` plugin
+* New: Support for new article metadata `article.modified_date`
 
 Visual Style
 ------------

+ 5 - 1
templates/article.html

@@ -83,7 +83,11 @@
             {% set day = article.date.strftime('%d')|int %}
             <time pubdate="pubdate" datetime="{{ article.date.isoformat() }}">{{ article.date.strftime('%b') }} {{ day }} {{- article.date.strftime(', %Y') }}</time>
             {% endif %}
-            {% if article.modified %} 
+            {% if article.modified_date %}
+            <h4>Last Updated</h4>
+            {% set day = article.modified_date.strftime('%d')|int %}
+            <time datetime="{{ article.modified_date.isoformat() }}">{{ article.modified_date.strftime('%b') }} {{ day }} {{- article.modified_date.strftime(', %Y') }}</time>
+            {% elif article.modified %}
             <h4>Last Updated</h4>
             <div class="last-updated">{{ article.modified }}</div>
             {% endif %}

+ 5 - 1
templates/page.html

@@ -46,7 +46,11 @@
             {% set day = page.date.strftime('%d')|int %}
             <time pubdate="pubdate" datetime="{{ page.date.isoformat() }}">{{ page.date.strftime('%b') }} {{ day }} {{- page.date.strftime(', %Y') }}</time>
             {% endif %}
-            {% if page.modified %} 
+            {% if page.modified_date %}
+            <h4>Last Updated</h4>
+            {% set day = page.modified_date.strftime('%d')|int %}
+            <time datetime="{{ page.modified_date.isoformat() }}">{{ page.modified_date.strftime('%b') }} {{ day }} {{- page.modified_date.strftime(', %Y') }}</time>
+            {% elif page.modified %}
             <h4>Last Updated</h4>
             <div class="last_updated">{{ page.modified }}</div>
             {% endif %}