diff --git a/_includes/datetime.html b/_includes/datetime.html new file mode 100644 index 0000000..47e38bd --- /dev/null +++ b/_includes/datetime.html @@ -0,0 +1,21 @@ + + +{% assign wrap_elem = include.wrap | default: 'em' %} + +{% if site.prefer_datetime_locale == 'en' or lang == 'en' %} + {% assign df_strftime = '%b %e, %Y' %} + {% assign df_dayjs = 'll' %} +{% else %} + {% assign df_strftime = '%F' %} + {% assign df_dayjs = 'YYYY-MM-DD' %} +{% endif %} + +<{{ wrap_elem }} class="{% if include.class %}{{ include.class }}{% endif %}" + data-ts="{{ include.date | date: '%s' }}" + data-df="{{ df_dayjs }}" + {% if include.tooltip %}data-toggle="tooltip" data-placement="bottom"{% endif %}> + {{ include.date | date: df_strftime }} + diff --git a/_includes/related-posts.html b/_includes/related-posts.html index bbda00b..a673b19 100644 --- a/_includes/related-posts.html +++ b/_includes/related-posts.html @@ -60,7 +60,6 @@ {% assign less = TOTAL_SIZE | minus: index_list.size %} {% if less > 0 %} - {% for i in (0..last_index) %} {% assign post = site.posts[i] %} {% if post.url != page.url %} @@ -74,10 +73,8 @@ {% endunless %} {% endif %} {% endfor %} - {% endif %} - {% if index_list.size > 0 %}