gjtorikian / jekyll-last-modified-at

A Jekyll plugin to show the last_modified_at time of a post.
MIT License
241 stars 38 forks source link

determinator.rb: Check is git repo only once #61

Closed jayvdb closed 4 years ago

jayvdb commented 6 years ago

When there is no git repository, is_git_repo? was false, and the ||= checks for a git repository every invocation.

Fixes https://github.com/gjtorikian/jekyll-last-modified-at/issues/60

jayvdb commented 6 years ago

Note that the second commit caches per site, which likely wont handle git submodules correctly. To fix that, the caching would need to be per directory, or the per site logic would need to check for submodules and use a different cache key for each submodule. However I suspect that git submodules is not a large percentage of the userbase. Please let me know if you consider that usage important and I'll dig around a little bit.

gjtorikian commented 4 years ago

Thanks! I'll sort out the build errors on my own end.