Datetime format (#2844)

* datetime_format

* page__meta

* page__date

* page__date test

* update docs

* update docs
This commit is contained in:
luweizheng
2021-04-14 03:58:37 +08:00
committed by GitHub
parent 2e05b8568b
commit c521fe58df
3 changed files with 11 additions and 3 deletions

View File

@@ -5,7 +5,8 @@
{% assign date = document.date %}
<span class="page__meta-date">
<i class="far {% if include.type == 'grid' and document.read_time and document.show_date %}fa-fw {% endif %}fa-calendar-alt" aria-hidden="true"></i>
<time datetime="{{ date | date_to_xmlschema }}">{{ date | date: "%B %-d, %Y" }}</time>
{% assign date_format = site.date_format | default: "%B %-d, %Y" %}
<time datetime="{{ date | date_to_xmlschema }}">{{ date | date: date_format }}</time>
</span>
{% endif %}