Skip to content

Commit a1d51d7

Browse files
lsolesenchukycheese
authored andcommitted
Move page date to own file (mmistakes#2544)
1 parent 9b685ed commit a1d51d7

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

_includes/page__date.html

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{% if page.last_modified_at %}
2+
<p class="page__date"><strong><i class="fas fa-fw fa-calendar-alt" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].date_label | default: "Updated:" }}</strong> <time datetime="{{ page.last_modified_at | date: "%Y-%m-%d" }}">{{ page.last_modified_at | date: "%B %-d, %Y" }}</time></p>
3+
{% elsif page.date %}
4+
<p class="page__date"><strong><i class="fas fa-fw fa-calendar-alt" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].date_label | default: "Updated:" }}</strong> <time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: "%B %-d, %Y" }}</time></p>
5+
{% endif %}

_layouts/single.html

+1-5
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@
5151
<h4 class="page__meta-title">{{ site.data.ui-text[site.locale].meta_label }}</h4>
5252
{% endif %}
5353
{% include page__taxonomy.html %}
54-
{% if page.last_modified_at %}
55-
<p class="page__date"><strong><i class="fas fa-fw fa-calendar-alt" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].date_label | default: "Updated:" }}</strong> <time datetime="{{ page.last_modified_at | date: "%Y-%m-%d" }}">{{ page.last_modified_at | date: "%B %-d, %Y" }}</time></p>
56-
{% elsif page.date %}
57-
<p class="page__date"><strong><i class="fas fa-fw fa-calendar-alt" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].date_label | default: "Updated:" }}</strong> <time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: "%B %-d, %Y" }}</time></p>
58-
{% endif %}
54+
{% include page__date.html %}
5955
</footer>
6056

6157
{% if page.share %}{% include social-share.html %}{% endif %}

0 commit comments

Comments
 (0)