2020-07-23 16:23:31 +02:00
|
|
|
<!--
|
|
|
|
Date format snippet
|
2021-12-03 23:56:33 +01:00
|
|
|
See: ${JS_ROOT}/utils/timeago.js
|
2020-07-23 16:23:31 +02:00
|
|
|
-->
|
2021-01-23 20:02:19 +01:00
|
|
|
|
2021-08-01 15:54:27 +02: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-23 20:02:19 +01:00
|
|
|
|
2021-12-03 23:56:33 +01:00
|
|
|
<em class="timeago{% if include.class %} {{ include.class }}{% endif %}"
|
2022-01-24 18:18:25 +01:00
|
|
|
date="{{ include.date | date_to_xmlschema }}"
|
2021-12-03 23:56:33 +01:00
|
|
|
{% if include.tooltip %}
|
|
|
|
data-toggle="tooltip"
|
|
|
|
data-placement="bottom"
|
|
|
|
title="{{ include.date | date: tooltip_df }}"
|
|
|
|
{% endif %}>
|
|
|
|
|
2021-07-20 19:01:09 +02:00
|
|
|
{%- assign this_year = site.time | date: "%Y" -%}
|
|
|
|
{%- assign post_year = include.date | date: "%Y" -%}
|
2021-12-03 23:56:33 +01:00
|
|
|
|
2021-07-20 19:01:09 +02:00
|
|
|
{%- if post_year == this_year -%}
|
2021-01-23 20:02:19 +01:00
|
|
|
{{ include.date | date: post_short_df }}
|
2021-07-20 19:01:09 +02:00
|
|
|
{%- else -%}
|
2021-01-23 20:02:19 +01:00
|
|
|
{{ include.date | date: post_long_df }}
|
2021-07-20 19:01:09 +02:00
|
|
|
{%- endif -%}
|
2021-12-03 23:56:33 +01:00
|
|
|
</em>
|