gjtorikian / jekyll-last-modified-at

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

Add option to set `page.date` automatically with the file creation date #91

Open khemarato opened 3 years ago

khemarato commented 3 years ago

This PR builds on @klandergren's git-cache PR: https://github.com/gjtorikian/jekyll-last-modified-at/pull/87

It adds support for the "first posted at" variable suggested in https://github.com/gjtorikian/jekyll-last-modified-at/issues/90 but places that variable instead in the page.date slot so that it will work out-of-the-box with other plugins (such as jekyll-feed) which rely on the page.date variable.

redstreet commented 3 years ago

@gjtorikian, any chance you could take a look and merge this PR? 🙏

gjtorikian commented 3 years ago

Yeah, I will look at this this week!

gjtorikian commented 3 years ago

I can tell you right now though that there should be tests in here for that functionality.

redstreet commented 3 years ago

Thank you, @gjtorikian! I see @buddhist-uni has already given your message a thumbs up and will probably create tests 🙂. 🙏 to both!

khemarato commented 3 years ago

Oh just to be clear, I was agreeing that there should be tests... I wasn't volunteering to write them 😂 I have no experience with this testing framework and (for complicated reasons) won't have access to a laptop for a while.

redstreet commented 3 years ago

Ah heh, didn't mean to volunteer you for that, apologies 😄

khemarato commented 3 years ago

No worries! I appreciate your enthusiastic support 😊

BTW: When I did more thorough testing, I found that implicit (filename) dates were indeed being overriden by the plugin! You will have to add frontmatter dates for posts that were committed on a different day than their name implies.

{% note to self %} I have a theory that simply setting a frontmatter default of date: nil on posts should do the trick as it will clear the plugin and open the way for the default (filename) date. Once that behavior is confirmed / controverted, the README will have to be updated accordingly. {% endnote %}

The above also points to the big question I had RE testing, @gjtorikian: The most brittle part of this is the integration with Jekyll, yet there seems to be no good way to unit test that integration with ruby specs, huh?

gjtorikian commented 6 months ago

👋 Unfortunately, my GitHub notifications for this repository was oddly turned off. I take my responsibility to accepting patches seriously; however, I am just one person, with a very busy life off of GitHub.com! I'm going to close this PR because I like to keep my TODO list scoped and reasonable. This does not mean I will not accept this patch! Rather, it's a way of me asking you if you're still using this gem, and whether you want this PR merged. Just comment back and I'll prioritize it. I assume silence means I can keep it closed. Thanks!

this was an automated copy-paste

khemarato commented 6 months ago

I'm still using this