2020-07-23 17:23:31 +03:00
|
|
|
<!--
|
|
|
|
Date format snippet
|
2021-03-03 13:32:06 +03:00
|
|
|
See: /assets/js/_utils/timeage.js
|
2020-07-23 17:23:31 +03:00
|
|
|
-->
|
2021-01-23 22:02:19 +03:00
|
|
|
|
|
|
|
{% assign tooltip_df = site.data.date_format.tooltip | default: '%a, %b %e, %Y, %l:%M %p %z' %}
|
|
|
|
{% assign post_long_df = site.data.date_format.post.long | default: '%b %e, %Y' %}
|
|
|
|
{% assign post_short_df = site.data.date_format.post.short | default: '%b %e' %}
|
|
|
|
|
2021-07-11 12:04:13 +03:00
|
|
|
{% if include.preposition %}
|
|
|
|
{{ include.preposition }}
|
|
|
|
{% endif %}
|
2020-07-23 17:23:31 +03:00
|
|
|
<span class="timeago {% if include.class %}{{ include.class }}{% endif %}"
|
|
|
|
{% if include.tooltip %}
|
|
|
|
data-toggle="tooltip"
|
|
|
|
data-placement="bottom"
|
2021-01-23 22:02:19 +03:00
|
|
|
title="{{ include.date | date: tooltip_df }}"
|
2021-03-03 13:32:06 +03:00
|
|
|
{% endif %}
|
2021-07-11 12:04:13 +03:00
|
|
|
{% if include.prefix %}prefix="{{ include.prefix }} "{% endif%}>
|
2020-07-23 17:23:31 +03:00
|
|
|
|
|
|
|
{% assign this_year = site.time | date: "%Y" %}
|
|
|
|
{% assign post_year = include.date | date: "%Y" %}
|
|
|
|
|
|
|
|
{% if post_year == this_year %}
|
2021-01-23 22:02:19 +03:00
|
|
|
{{ include.date | date: post_short_df }}
|
2020-07-23 17:23:31 +03:00
|
|
|
{% else %}
|
2021-01-23 22:02:19 +03:00
|
|
|
{{ include.date | date: post_long_df }}
|
2020-07-23 17:23:31 +03:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<i class="unloaded">{{ include.date | date_to_xmlschema }}</i>
|
|
|
|
|
2021-01-23 22:02:19 +03:00
|
|
|
</span>
|