Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

khemarato
Copy link

This PR builds on @klandergren's git-cache PR: #87

It 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 as jekyll-feed) which rely on the page.date variable.

klandergren and others added 3 commits May 18, 2021 15:37
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.
README.md Outdated Show resolved Hide resolved
@khemarato khemarato marked this pull request as ready for review November 15, 2021 01:58
@redstreet
Copy link

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

@gjtorikian
Copy link
Owner

Yeah, I will look at this this week!

@gjtorikian
Copy link
Owner

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

@redstreet
Copy link

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

@khemarato
Copy link
Author

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
Copy link

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

@khemarato
Copy link
Author

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
Copy link
Owner

👋 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

@gjtorikian gjtorikian closed this Jun 4, 2024
@khemarato
Copy link
Author

I'm still using this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants