staticsite icon indicating copy to clipboard operation
staticsite copied to clipboard

Get default page timestamp from git

Open valholl opened this issue 8 years ago • 2 comments

It would be nice if staticsite could be configured to read the fallback page date from git log instead of the filesystem, because the latter is easily made inaccurate by actions such as moving the repository around, push/pull at a different time, etc.

valholl avatar Apr 16 '16 07:04 valholl

The way I currently use it is by having the date stored in the front matter of each post, and having ssite new generate it.

I like the idea of using git as a better fallback than the file mtime when a file does not have a front matter, though. How time consuming would it be to ask git for the time of the latest log entry for each file in the repo?

spanezz avatar Apr 18 '16 11:04 spanezz

A possible implementation idea is to add a git feature that queries information from the current commit or working tree all in one go, then adds it to metadata defaults as pages are loaded

spanezz avatar Dec 15 '19 13:12 spanezz