Skip to content

Commit

Permalink
Add support for customizable date format (daattali#533)
Browse files Browse the repository at this point in the history
* Add support for customizable date format

* Add support for customizable date format
  • Loading branch information
bangjunyoung authored and daattali committed Aug 14, 2019
1 parent e58cd52 commit 96c2508
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h2 class="{{ include.type }}-subheading">{{ page.subtitle }}</h2>
{% 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>
Expand All @@ -61,7 +61,7 @@ <h2 class="{{ include.type }}-subheading">{{ page.subtitle }}</h2>
{% 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>
Expand Down
2 changes: 1 addition & 1 deletion tags.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h2 id="{{- tag -}}" class="linked-section">
<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 -%}
Expand Down

0 comments on commit 96c2508

Please sign in to comment.