diff --git a/_data/date_format.yml b/_data/date_format.yml index 3040be7ec..0a984ffae 100644 --- a/_data/date_format.yml +++ b/_data/date_format.yml @@ -6,4 +6,6 @@ tooltip: "%a, %b %e, %Y, %l:%M %p %z" -post: "%b %e, %Y" \ No newline at end of file +post: + long: "%b %e, %Y" + short: "%b %e" diff --git a/_includes/related-posts.html b/_includes/related-posts.html index bfe4e49dd..fa256f3e6 100644 --- a/_includes/related-posts.html +++ b/_includes/related-posts.html @@ -93,10 +93,7 @@
diff --git a/_includes/timeago.html b/_includes/timeago.html new file mode 100644 index 000000000..b6b7bcda4 --- /dev/null +++ b/_includes/timeago.html @@ -0,0 +1,27 @@ + + + + {% assign this_year = site.time | date: "%Y" %} + {% assign post_year = include.date | date: "%Y" %} + + {% if post_year == this_year %} + {{ include.date | date: site.data.date_format.post.short }} + {% else %} + {{ include.date | date: site.data.date_format.post.long }} + {% endif %} + + {{ include.date | date_to_xmlschema }} + + \ No newline at end of file diff --git a/_layouts/category.html b/_layouts/category.html index a53aff5fc..70fec40fd 100644 --- a/_layouts/category.html +++ b/_layouts/category.html @@ -18,7 +18,7 @@ layout: page