2020-07-23 22:23:31 +08:00
|
|
|
<!--
|
|
|
|
Date format snippet
|
2021-03-03 18:32:06 +08:00
|
|
|
See: /assets/js/_utils/timeage.js
|
2020-07-23 22:23:31 +08:00
|
|
|
-->
|
2021-01-24 03:02:19 +08:00
|
|
|
|
2021-08-01 21:54:27 +08:00
|
|
|
{% assign tooltip_df = site.data.locales[lang].date_format.tooltip %}
|
|
|
|
{% assign post_long_df = site.data.locales[lang].date_format.post.long %}
|
|
|
|
{% assign post_short_df = site.data.locales[lang].date_format.post.short %}
|
2021-01-24 03:02:19 +08:00
|
|
|
|
2021-07-11 17:04:13 +08:00
|
|
|
{% if include.preposition %}
|
|
|
|
{{ include.preposition }}
|
|
|
|
{% endif %}
|
2020-07-23 22:23:31 +08:00
|
|
|
<span class="timeago {% if include.class %}{{ include.class }}{% endif %}"
|
|
|
|
{% if include.tooltip %}
|
|
|
|
data-toggle="tooltip"
|
|
|
|
data-placement="bottom"
|
2021-01-24 03:02:19 +08:00
|
|
|
title="{{ include.date | date: tooltip_df }}"
|
2021-07-21 01:01:09 +08:00
|
|
|
{% endif %}>
|
|
|
|
{%- assign this_year = site.time | date: "%Y" -%}
|
|
|
|
{%- assign post_year = include.date | date: "%Y" -%}
|
|
|
|
{%- if post_year == this_year -%}
|
2021-01-24 03:02:19 +08:00
|
|
|
{{ include.date | date: post_short_df }}
|
2021-07-21 01:01:09 +08:00
|
|
|
{%- else -%}
|
2021-01-24 03:02:19 +08:00
|
|
|
{{ include.date | date: post_long_df }}
|
2021-07-21 01:01:09 +08:00
|
|
|
{%- endif -%}
|
2020-07-23 22:23:31 +08:00
|
|
|
<i class="unloaded">{{ include.date | date_to_xmlschema }}</i>
|
2021-01-24 03:02:19 +08:00
|
|
|
</span>
|