ivantsepp / jekyll-git_metadata

Expose Git metadata to Jekyll.
MIT License
67 stars 25 forks source link

Cache git metadata #14

Closed citizenmatt closed 7 years ago

citizenmatt commented 7 years ago

Saves and loads the git metadata to a local cache file. Makes it a lot quicker to regenerate the site when a single file changes, while still maintaining git metadata.

ivantsepp commented 7 years ago

AWESOME! great idea!

One question I have is should there be some cleanup code for the cache directory? (we can always create another ticket/PR for that).

Overall LGTM and ready to merge pending your response to ^.

citizenmatt commented 7 years ago

I did look to see if I could hook into jekyll clean, but that doesn't look like it's extensible, so there's no cache management. I pretty much decided to just ignore it :) I'm not expecting many files, or for them to be very large, so I was ok with occasional manual clean up.

I guess it could be handled by only ever caching the current commit - if the current commit doesn't exist, delete any other cache file and create it. It would mean regenerating cache files if switching branches or commits, but that's not much different to now. At least subsequent site updates would be quicker.

ivantsepp commented 7 years ago

Thanks for the investigation!

I still feel icky about the cache files being proliferated. I'll go ahead and make a separate issue for it as a follow up if you don't mind!

citizenmatt commented 7 years ago

Cool, thanks! A separate issue is a good idea, to figure out best way to handle this.