spanezz / staticsite

Static site generator
GNU General Public License v3.0
46 stars 7 forks source link

Get default page timestamp from git #3

Open valholl opened 8 years ago

valholl commented 8 years ago

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.

spanezz commented 8 years ago

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 commented 4 years ago

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