-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Use date_format if set in configuration #70
Conversation
If it is not set, fall back to the previous default.
See issue #69 |
/cc @jekyll/minima What do you think? Should we name this differently? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but lacks documentation.
I might do |
I have written a plugin <!-- 'theme.date_format' is an alias for 'site.data.minima.date_format' -->
{% assign date_format = theme.date_format %}
{% if theme.date_format %}
<span class="post-meta">{{ post.date | date: date_format }}</span>
{% else %}
<span class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</span>
{% endif %} |
Don't know if there is any performance impact. I though that using the Something like
Is there any pros and cons? |
|
yeah, based on what Parkr recommends, I was thinking of something like: Change default date formatYou can do so by specifying
I would even add the above snippet by default in the |
If it's a site configuration flag, I don't understand why it'd be in a data file (content), rather than |
because to me, I may be wrong in thinking that data files can blur the lines between content and configuration, but its worth a shot. 😃 |
* Configuration as `site.minima.date_format` instead of top level. * Update README with information about it * Add example in `_config.yml` file * Use assign-default instead of if-then-else
@ward Thanks! |
Any update on when this will be merged in? |
@jekyllbot: merge +minor. Thanks @ward! Sorry for the delay in getting this merged. |
Would it be possible to have a release that includes this change? Thanks. |
@ward @Sathors FYI if you want to benefit from the latest changes on the theme you can always point to the gem "minima", :git => "https://github.com/jekyll/minima.git", :branch => "master" |
Thanks for the tips, I knew about it, but it is more maintenance burden. More than anything, it is because the Readme does indicate this option, so one is expecting it to be present in the release. Thank you nonetheless. |
Merge pull request 70
If it is not set, fall back to the previous default.