Open kevinrenskers opened 3 days ago
It seems that git-restore-mtime could solve the file modification date issues. This is not installed on Netlify, I've sent them a feature request.
I think this should be added to the documentation, so that people at least are aware of the behavior of the file attributes not being reliable.
OK this totally works 🎉 https://github.com/loopwerk/loopwerk.io/commit/e94cb8597aefced031496dc1110b071afb29aeb7
Currently Saga reads the file's creation and last modified dates, and stores those into the
Item
. The dates are then used inside of the atom feed generation for example. But the creation date is also the fallback for the published date: if you don't include adate
field in your markdown metadata then the published date is set to the file creation date.This is a problem because the file creation date is not stored in git, and when you do a fresh checkout the file creation date is set to "right now" instead of the actual past creation date. This is also a problem on my own website. While I do override the published date to something consistent, the last modified date is used in the atom feed.. and these dates just keep on changing because Netlify fetches the repo and the dates change.
Basically, using file attributes doesn't seem like a good idea?
On the other hand, this is not a problem with Saga but a problem with git. For people who don't store their website in git or who create the static sites on their own computer, this wouldn't be a problem. So maybe it would be better to add something to the Saga docs about this?
See also https://stackoverflow.com/questions/1964470/whats-the-equivalent-of-subversions-use-commit-times-for-git: