ソースを参照

Change modified_date metadata to modified

My [pull request](https://github.com/getpelican/pelican/issues/1152) got
closed in favor of [1148](https://github.com/getpelican/pelican/pull/1148).

This means Pelican is going to use `modified` keyword instead of
`modified_date`.

This patch reflects this change in Pelican.
Talha Mansoor 11 年 前
コミット
681ee9ae72
共有3 個のファイルを変更した7 個の追加13 個の削除を含む
  1. 1 1
      RELEASE_NOTES.md
  2. 3 6
      templates/article.html
  3. 3 6
      templates/page.html

+ 1 - 1
RELEASE_NOTES.md

@@ -8,7 +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`
+* New: Support for new metadata `modified`
 
 Visual Style
 ------------

+ 3 - 6
templates/article.html

@@ -83,13 +83,10 @@
             {% 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_date %}
+            {% if article.modified %}
             <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>
+            {% set day = article.modified.strftime('%d')|int %}
+            <time datetime="{{ article.modified.isoformat() }}">{{ article.modified.strftime('%b') }} {{ day }} {{- article.modified.strftime(', %Y') }}</time>
             {% endif %}
             {% if article.category %}
             <h4>Category</h4>

+ 3 - 6
templates/page.html

@@ -46,13 +46,10 @@
             {% 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_date %}
+            {% if page.modified %}
             <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>
+            {% set day = page.modified.strftime('%d')|int %}
+            <time datetime="{{ page.modified.isoformat() }}">{{ page.modified.strftime('%b') }} {{ day }} {{- page.modified.strftime(', %Y') }}</time>
             {% endif %}
             {% include 'social_links.html' %}
             {% include 'mailchimp.html' %}