From e8380e612fae18493556d620726a9069a17128db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 1 Nov 2016 23:04:12 +0100 Subject: Add GitInfo This commit adds a `GitInfo` object to `Page` if `EnableGitInfo` is set. It then also sets `Lastmod` for the given `Page` to the author date provided by Git. The Git integrations should be fairly performant, but it adds "some time" to the build, somewhat depending on the Git history size. If you want, you can run without during development and turn it on when deploying to the live server: `hugo --enableGitInfo`. Fixes #2102 --- hugolib/config.go | 1 + 1 file changed, 1 insertion(+) (limited to 'hugolib/config.go') diff --git a/hugolib/config.go b/hugolib/config.go index 2dfe128a6..94477b75a 100644 --- a/hugolib/config.go +++ b/hugolib/config.go @@ -106,4 +106,5 @@ func loadDefaultSettings() { viper.SetDefault("defaultContentLanguage", "en") viper.SetDefault("defaultContentLanguageInSubdir", false) viper.SetDefault("enableMissingTranslationPlaceholders", false) + viper.SetDefault("enableGitInfo", false) } -- cgit v1.2.3