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

Date formatting does not work #75

Open fingolfin opened 4 years ago

fingolfin commented 4 years ago

I used gem install jekyll-last-modified-at to get version 1.2.1 of this plugin. For testing, In inserted this into a raw HTML file (not using any layouts or whatever, and with a trivial YAML header):

<ul>
<li>{% last_modified_at %}</li>
<li>{% last_modified_at %Y:%B:%A:%d:%S:%R %}</li>
<li>{{ page.last_modified_at }}</li>
<li>{{ page.last_modified_at | date: '%Y:%B:%A:%d:%S:%R' }}</li>
</ul>

These are simply the inputs from the README. But to my surprise, I got this output:

  • 15-Jan-16
  • 15-Jan-16
  • 2016-01-15 12:27:07 +0100
  • 2016:January:Friday:15:07:12:27

So the format string for last_modified_at is not actually having an effect...

fingolfin commented 4 years ago

Oh yeah, this is with Jekyll 4.0.0

rgooler commented 4 years ago

I suspect the issue is that, since they changed how caching works in jekyll, that this got broken: https://github.com/gjtorikian/jekyll-last-modified-at/blob/master/lib/jekyll-last-modified-at/determinator.rb#L22

However, I'm not sure how to fix it.

gjtorikian commented 4 years ago

since they changed how caching works in jekyll,

Interesting, can you link me to a PR or blog indicating this? I can try to take a look.