gjtorikian / jekyll-last-modified-at

A Jekyll plugin to show the last_modified_at time of a post.
MIT License
241 stars 38 forks source link

Added configuration #76

Closed socram8888 closed 4 years ago

socram8888 commented 4 years ago

This small modifications adds configurable options. Namely, it allows to change the default format (with the default being the current one), and an option to set the timezome to UTC (disabled by default).

Setting the timezone to UTC is IMHO pretty important and useful if the website is not build on a local PC but on a site such as GitHub Actions or any other pipeline where the timezone may change between runs.

socram8888 commented 4 years ago

I just realized I had missed the timezone option in the _config.yml. D'oh.

I should probably remove the whole UTC thing and keep only the option to have a custom default, right?

gjtorikian commented 4 years ago

Oh, this is cool. Does Jekyll use date_format anywhere on its own? I'd hate for this plugin to add its own config if one already exists.

socram8888 commented 4 years ago

Jekyll does not seem to have it implemented at all - the documentation at least mentions no such feature existing.

This same key name is used by another plugin already, however.

gjtorikian commented 4 years ago

Hmmm. I think I'd still rather not interfere since I don't know what Jekyll will do in the future.

How about we change it to:

jekyll-last-modified-at:
   date_format: <xxx>

in the config.yaml? That way we can add timezone or anything else in the future.

socram8888 commented 4 years ago

Done. First commit (582061e79094356ac95d633ae779de02be8c20c7) fixes that Jekyll is in UTC but the Time.now call was not, and at this time of the night (0:32 CEST) it was failing.

gjtorikian commented 4 years ago

Thanks, this is great. I'll release this as a new minor version now.