Last active
August 29, 2015 14:22
-
-
Save pigfly/4a396d183fd1cc1e7451 to your computer and use it in GitHub Desktop.
Gist for my post "Fix date not get rendered after upgrade octopress"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h5 class="date-time">{% include post/date.html %}<i class="icon-calendar"></i> {{ time }}</h5> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% capture date %}{{ page.date }}{{ post.date }}{% endcapture %} | |
{% capture date_formatted %}{{ page.date_formatted }}{{ post.date_formatted }}{% endcapture %} | |
{% capture has_date %}{{ date | size }}{% endcapture %} | |
{% capture updated %}{{ page.updated }}{{ post.updated }}{% endcapture %} | |
{% capture updated_formatted %}{{ page.updated_formatted }}{{ post.updated_formatted }}{% endcapture %} | |
{% capture was_updated %}{{ updated | size }}{% endcapture %} | |
{% if has_date != '0' %} | |
{% capture time %}<time datetime="{{ date | datetime | date_to_xmlschema }}" {% if updated %}data-updated="true"{% endif %} itemprop="datePublished">{{ date_formatted }}</time>{% endcapture %} | |
{% endif %} | |
{% if was_updated != '0' %} | |
{% capture updated %}<time datetime="{{ updated | datetime | date_to_xmlschema }}" class="updated" itemprop="dateModified">Updated {{ updated_formatted }}</time>{% endcapture %} | |
{% else %}{% assign updated = false %}{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1c1 | |
< <h5 class="date-time">{% include post/date.html %}<i class="icon-calendar"></i> {{ time }}</h5> | |
--- | |
> <div class="date">{% include post/date.html %}{{ time }}</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if page.date %}{% capture time %}{{ page.date_time_html }}{% endcapture %}{% endif %} | |
{% if post.date %}{% capture time %}{{ post.date_time_html }}{% endcapture %}{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,15 +1,5 @@ | |
-{% capture date %}{{ page.date }}{{ post.date }}{% endcapture %} | |
-{% capture date_formatted %}{{ page.date_formatted }}{{ post.date_formatted }}{% endcapture %} | |
-{% capture has_date %}{{ date | size }}{% endcapture %} | |
+{% if page.date %}{% capture time %}{{ page.date_time_html }}{% endcapture %}{% endif %} | |
+{% if post.date %}{% capture time %}{{ post.date_time_html }}{% endcapture %}{% endif %} | |
-{% capture updated %}{{ page.updated }}{{ post.updated }}{% endcapture %} | |
-{% capture updated_formatted %}{{ page.updated_formatted }}{{ post.updated_formatted }}{% endcapture %} | |
-{% capture was_updated %}{{ updated | size }}{% endcapture %} | |
- | |
-{% if has_date != '0' %} | |
- {% capture time %}<time datetime="{{ date | datetime | date_to_xmlschema }}" pubdate{% if updated %} data-updated="true"{% endif %}>{{ date_formatted }}</time>{% endcapture %} | |
-{% endif %} | |
- | |
-{% if was_updated != '0' %} | |
- {% capture updated %}<time datetime="{{ updated | datetime | date_to_xmlschema }}" class="updated">Updated {{ updated_formatted }}</time>{% endcapture %} | |
-{% else %}{% assign updated = false %}{% endif %} | |
+{% if page.updated %}{% capture updated %}{{ page.date_time_updated_html }}{% endcapture %}{% endif %} | |
+{% if post.updated %}{% capture updated %}{{ post.date_time_updated_html }}{% endcapture %}{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<time class='entry-date' datetime='2014-07-03T14:08:00+00:00'> | |
<span class='date'> | |
<span class='date-month'>Jul</span> | |
<span class='date-day'>3</span><span class='date-suffix'>rd</span>, | |
<span class='date-year'>2014</span> | |
</span> | |
<span class='time'>2:08 pm</span> | |
</time> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment