{% 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 %} {%- assign this_year = site.time | date: "%Y" -%} {%- assign post_year = include.date | date: "%Y" -%} {%- if post_year == this_year -%} {{ include.date | date: post_short_df }} {%- else -%} {{ include.date | date: post_long_df }} {%- endif -%}