Browse code

Time metadata for updated pages and posts are now displayed where and when it is appropriate

Brandon Mathis authored on 04/09/2011 at 19:18:28
Showing 4 changed files
... ...
@@ -6,7 +6,7 @@
6 6
       <h1 class="entry-title">{{ page.title | titlecase }}</h1>
7 7
     {% endif %}
8 8
     {% unless page.meta == false %}
9
-      <p class="meta">{% include post/date.html %}</p>
9
+      <p class="meta">{% include post/date.html %}{{ time }}</p>
10 10
     {% endunless %}
11 11
   </header>
12 12
 {% endunless %}
... ...
@@ -2,9 +2,11 @@
2 2
 {% capture has_date %}{{ date | size }}{% endcapture %}
3 3
 {% capture updated %}{{ page.updated }}{{ post.updated }}{% endcapture %}
4 4
 {% capture was_updated %}{{ updated | size }}{% endcapture %}
5
+
5 6
 {% if has_date != '0' %}
6
-<time datetime="{{ date | datetime | date_to_xmlschema }}" pubdate {% if updated %} data-updated="true" {% endif %}>{{ date | ordinalize }}</time>
7
+  {% capture time %}<time datetime="{{ date | datetime | date_to_xmlschema }}" pubdate {% if updated %} data-updated="true" {% endif %}>{{ date | ordinalize }}</time>{% endcapture %}
7 8
 {% endif %}
9
+
8 10
 {% if was_updated != '0' %}
9
-<time class="updated" datetime="{{ updated | datetime | date_to_xmlschema }}">{{ updated | ordinalize }}</time>
10
-{% endif %}
11
+  {% capture updated %}<time class="updated" datetime="{{ updated | datetime | date_to_xmlschema }}">Updated {{ updated | ordinalize }}</time>{% endcapture %}
12
+{% else %}{% assign updated = false %}{% endif %}
... ...
@@ -15,7 +15,7 @@ layout: default
15 15
     <footer>
16 16
       {% if page.date or page.author %}<p class="meta">
17 17
         {% if page.author %}{% include post/author.html %}{% endif %}
18
-        {% include post/date.html %}
18
+        {% include post/date.html %}{% if updated %}{{ updated }}{% else %}{{ time }}{% endif %}
19 19
         {% if page.categories %}{% include post/categories.html %}{% endif %}
20 20
       </p>{% endif %}
21 21
       {% unless page.sharing == false %}
... ...
@@ -9,7 +9,7 @@ single: true
9 9
   <footer>
10 10
     <p class="meta">
11 11
       {% include post/author.html %}
12
-      {% include post/date.html %}
12
+      {% include post/date.html %}{% if updated %}{{ updated }}{% else %}{{ time }}{% endif %}
13 13
       {% include post/categories.html %}
14 14
     </p>
15 15
     {% unless page.sharing == false %}