Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for customizable date format #533

Merged
merged 2 commits into from
Aug 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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