Skip to content

Commit 2438826

Browse files
committed
Add date to cross-sold articles
1 parent cdf1c15 commit 2438826

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

_includes/cross-sell.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
{% assign random = site.time | date: "%s%N" | modulo: site.posts.size %}
44

55
<h4 class="c-cross-sell__title">You might also like…</h4>
6-
<h5 class="c-cross-sell__link"><a href="{{ site.posts[random].url }}"><cite>{{ site.posts[random].title }}</cite></a></h5>
6+
<h5 class="c-cross-sell__link">
7+
<a href="{{ site.posts[random].url }}">
8+
<cite>{{ site.posts[random].title }}</cite>
9+
<small>(<time>{{ site.posts[random].date | date: "%Y" }}</time>)</small>
10+
</a>
11+
</h5>
712

813
</aside>
914

archive.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<p>I have written <b>{{ site.posts | size }}</b> post on this site, mostly
1313
covering CSS, architecture, performance, and web development. Find
1414
a reverse-chronological list of them below, or, at random, why not read
15-
<a href="{{ site.posts[random].url }}"><cite>{{ site.posts[random].title }}</cite></a>?</p>
15+
<a href="{{ site.posts[random].url }}"><cite>{{ site.posts[random].title }}</cite></a> <small>(<time>{{ site.posts[random].date | date: "%Y" }}</time>)</small>?</p>
1616

1717
{% for post in site.posts %}
1818
{% assign currentDate = post.date | date: "%Y" %}

0 commit comments

Comments
 (0)