Переглянути джерело

Uses html5 time tag for dates

Talha Mansoor 11 роки тому
батько
коміт
231a98ad45
3 змінених файлів з 4 додано та 4 видалено
  1. 1 1
      templates/archives.html
  2. 2 2
      templates/article.html
  3. 1 1
      templates/categories.html

+ 1 - 1
templates/archives.html

@@ -15,7 +15,7 @@ All Posts - {{ super() }}
         <ul class="list-all-articles">
             {% for article in dates %}
             <li><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a>
-            <time>{{ article.locale_date }}</time>
+            <time datetime="{{ article.date }}">{{ article.locale_date }}</time>
             </li>
             {% endfor %}
         </ul>

+ 2 - 2
templates/article.html

@@ -24,10 +24,10 @@
         {{ article.content }}
     </div>
     <div class="span2 offset1">
-        <h4>Published</h4>
         {% if article.date %} 
+        <h4>Published</h4>
         {% set day = article.date.strftime('%d')|int %}
-        {{ article.date.strftime('%b') }} {{ day }} {{- article.date.strftime(', %Y') }}    
+        <time datetime="{{ article.date }}">{{ article.date.strftime('%b') }} {{ day }} {{- article.date.strftime(', %Y') }}</time>
         {% endif %}
         {% if article.modified %} 
         <h4>Last Updated</h4>

+ 1 - 1
templates/categories.html

@@ -34,7 +34,7 @@ All Categories - {{ super() }}
                     <div class="accordion-inner">
                         <ul class="list-articles-category">
                             {% for article in articles %} 
-                            <li><span>{{ article.locale_date }}</span> <a href="{{ article.url }}">{{ article.title }}</a></li>
+                            <li><span><time datetime="{{ article.date }}">{{ article.locale_date }}</time></span> <a href="{{ article.url }}">{{ article.title }}</a></li>
                             {% endfor %}
                         </ul>
                     </div>