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

Option for Git AuthorDate instead of CommitDate #53

Closed trickv closed 6 months ago

trickv commented 6 years ago

…for determining last modified date of content.

I think - based on my limited use of Git - that this might be a more accurate representation of content's last modified timestamp. In the case of my Jekyll site which contains a bunch of content imported from another content management system, the CommitDate on everything is the date it was imported into Git - whereas the AuthorDate is when the content was actually modified.

For the vast majority of users these dates will be identical - I wonder if this might be useful upstream?

jayvdb commented 6 years ago

For the vast majority of users these dates will be identical - I wonder if this might be useful upstream?

Not sure about 'vast majority', but this impact people who are not using a git merge based workflow, e.g. those using git rebase, including squashing), and impacts any case where there are merge conflicts that need to be resolved, which means the file was modified after the first authoring.

If the default is changed, IMO a config setting is needed to allow use of commit date.

trickv commented 6 years ago

You're right - whether I'm right or not about what people want, we shouldn't change the methodology of the add-on without offering people a way to keep the behavior the same. Or maybe I'm alone in wanting AuthorDate.

I'll have a look and see if I can write this as an option...I'm not very familiar with Jekyll but it can't be that hard, right?

jayvdb commented 6 years ago

I've started doing a bit of Jekyll hacking lately, including this plugin, and found it approachable. Check out my PRs which solve a few problems you may encounter. Ping me on gitter if you need a hand.

trickv commented 4 years ago

It's been a few years and I've come back to this PR to figure out how to make it an option. My workaround for the last 3 years has been just manually modifying the plugin whenever I rebuild my environment, so I finally got around to doing it properly :)

My commits today seem to work to me and would be worth another set of eyes looking at. I'm good at a lot of programming languages and Ruby is not one of them, so feel free to pick on my syntax.

The commits today add a second configurable option so now in my _config.yml I can say:

last-modified-at:
    git-authordate: True

The default is false and continues to use the original behavior of Commit Date.

Left to do:

VerzatileDev commented 11 months ago

It's been a few years and I've come back to this PR to figure out how to make it an option. My workaround for the last 3 years has been just manually modifying the plugin whenever I rebuild my environment, so I finally got around to doing it properly :)

My commits today seem to work to me and would be worth another set of eyes looking at. I'm good at a lot of programming languages and Ruby is not one of them, so feel free to pick on my syntax.

The commits today add a second configurable option so now in my _config.yml I can say:

last-modified-at:
    git-authordate: True

The default is false and continues to use the original behavior of Commit Date.

Left to do:

  • Document the option in README.md
  • See what Travis CI is failing builds on (it appears unrelated to my changes)

Interesting, I have been looking at something alike. If I get it to work, may I use the way you have done it, of course I would aim to reference it and possible consider updating it wherever possible.

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