-
-
Notifications
You must be signed in to change notification settings - Fork 38
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 option to set page.date
automatically with the file creation date
#91
base: main
Are you sure you want to change the base?
Conversation
This diff does two things: 1. aligns path_cache behavior in determinator.rb so that both formatted and raw calls to last_modified_time are read from the path_cache 2. adds option `use-git-cache` which improves render performance by reading the entire git log once (instead of 1:1 for each file)
`item.path` returns the absolute path to a file, whereas other instantiations of `Determinator`, like in `tag.rb`, use a relative path. by using a relative path in both places we increase the likelihood of cache hits.
with the file creation time
@gjtorikian, any chance you could take a look and merge this PR? 🙏 |
Yeah, I will look at this this week! |
I can tell you right now though that there should be tests in here for that functionality. |
Thank you, @gjtorikian! I see @buddhist-uni has already given your message a thumbs up and will probably create tests 🙂. 🙏 to both! |
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. |
Ah heh, didn't mean to volunteer you for that, apologies 😄 |
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 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? |
👋 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 |
I'm still using this |
This PR builds on @klandergren's
git-cache
PR: #87It adds support for the "first posted at" variable suggested in #90 but places that variable instead in the
page.date
slot so that it will work out-of-the-box with other plugins (such asjekyll-feed
) which rely on thepage.date
variable.