Add support for customizable date format (#533)

* Add support for customizable date format

* Add support for customizable date format
This commit is contained in:
Bang Jun-young 2019-08-15 03:10:59 +09:00 committed by Dean Attali
parent e58cd5259e
commit 96c25086b5
3 changed files with 6 additions and 3 deletions

View File

@ -150,6 +150,9 @@ excerpt_length: 50
# and RSS feed title
title-separator: "-"
# Ruby Date Format
date_format: "%B %-d, %Y"
# --- Don't need to touch anything below here (but you can if you want) --- #
# Output options (more information on Jekyll's site)

View File

@ -36,7 +36,7 @@
{% endif %}
{% if include.type == "post" %}
<span class="post-meta">Posted on {{ page.date | date: "%B %-d, %Y" }}</span>
<span class="post-meta">Posted on {{ page.date | date: site.date_format }}</span>
{% endif %}
</div>
</div>
@ -61,7 +61,7 @@
{% endif %}
{% if include.type == "post" %}
<span class="post-meta">Posted on {{ page.date | date: "%B %-d, %Y" }}</span>
<span class="post-meta">Posted on {{ page.date | date: site.date_format }}</span>
{% endif %}
</div>
</div>

View File

@ -25,7 +25,7 @@ title: 'Tag Index'
<div class="tag-entry">
<a href="{{ post.url | relative_url }}">{{- post.title -}}</a>
<div class="entry-date">
<time datetime="{{- post.date | date_to_xmlschema -}}">{{- post.date | date: "%B %d, %Y" -}}</time>
<time datetime="{{- post.date | date_to_xmlschema -}}">{{- post.date | date: site.date_format -}}</time>
</div>
</div>
{%- endfor -%}