Open redstreet opened 2 years ago
If you can provide the Git command to get the info you're interested in, I can probably add the feature in.
That would be terrific, thank you!
The git command is:
git log --diff-filter=A --follow --format=%aD -1 -- <fname>
For reference, from that page:
[The above command] gives the last "creation date" of a file in a repository, and does it regardless of file renames/moves.
Notes:
How do you feel about it setting page.date
instead of creating some new variable?
Hmm, that would depend on what page.date is currently set to and used for @buddhist-uni. I'm not familiar enough to know this, would you mind telling me?
In the attached draft, I've set page.date
to the "first-posted-at" time, as you suggested.
The advantage of using page.date
is that other plugins (such as jekyll-feed
and jekyll-seo-tag
) use page.date
variable to determine when the page was first published.
Thank you for this awesome PR, @buddhist-uni
On using page.date
:
this page shows some downsides, the main one being the permalink to the page could be lost if page.date
is a dynamic variable. This doesn't affect me, and I'm posting it merely for your consideration. An alternative idea is to set page.first-posted-at
, and include a set-page-date-instead: true
if the user optionally wanted it instead.
question for you: would it be possible to override what the plugin sets by setting page.date
via frontmatter?
left a comment on the git command to use (given above)
Thanks for the comments on the PR. I've addressed them there.
To answer your question: I just tested this locally, and the plugin hooks up the field before Jekyll applies frontmatter values. The permalinks for posts, therefore, don't change and any date
s you set in the frontmatter will override the value provided by the plugin. 😄
Terrific, looks great then! Thank you again a bunch for this PR!
First, thanks for this excellent plugin!
This is a feature request to add a "Originally created on" or
page.first-posted-at
, as a complement topage.last-modified-at
.I can see the
git log -n 1
command that can be easily modified but don't know enough ruby to make all the modifications needed to expose a new function such aspage.first-posted-at
. I see @gjtorikian is looking for maintainers already. So if anyone is willing to give me some pointers on how to structure the modifications, I can take a go at it.Thank you!