Make post's date output configurable via _config.yml, closes #164
A new config variable 'date_format' is introduced in _config.yml. It can either be set to "ordinal" to use the current format or it can be given a string complying to strftime() format identifiers.
This commit is contained in:
parent
ff7099207b
commit
c2a68cc2a9
4 changed files with 79 additions and 28 deletions
|
@ -1,10 +1,11 @@
|
|||
{% capture date %}{{ page.date }}{{ post.date }}{% endcapture %}
|
||||
{% capture date_formatted %}{{ page.date_formatted }}{{ post.date_formatted }}{% endcapture %}
|
||||
{% capture has_date %}{{ date | size }}{% endcapture %}
|
||||
{% capture updated %}{{ page.updated }}{{ post.updated }}{% endcapture %}
|
||||
{% capture was_updated %}{{ updated | size }}{% endcapture %}
|
||||
|
||||
{% if has_date != '0' %}
|
||||
{% capture time %}<time datetime="{{ date | datetime | date_to_xmlschema }}" pubdate {% if updated %} data-updated="true" {% endif %}>{{ date | ordinalize }}</time>{% endcapture %}
|
||||
{% capture time %}<time datetime="{{ date | datetime | date_to_xmlschema }}" pubdate {% if updated %} data-updated="true" {% endif %}>{{ date_formatted }}</time>{% endcapture %}
|
||||
{% endif %}
|
||||
|
||||
{% if was_updated != '0' %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue