diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-06-04 13:45:56 +0200 |
---|---|---|
committer | Steve Francia <steve.francia@gmail.com> | 2016-06-04 21:55:56 -0400 |
commit | a7f51703c4b3acdea7539bde6caed450183db18d (patch) | |
tree | cc1ee68c41bc2c0c9dc0e4c48c65f1bc2d8da7e6 /hugolib | |
parent | 80ebe0578a1b5cbdcb837be4afc5c58aedb8a20a (diff) |
Add Hugo generator tag to home page if not present
Fixes #2182
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/site.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/hugolib/site.go b/hugolib/site.go index bbbacb4a8..679fd202a 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -1960,6 +1960,13 @@ func (s *Site) renderAndWritePage(name string, dest string, d interface{}, layou transformLinks = append(transformLinks, transform.LiveReloadInject) } + // For performance reasons we only inject the Hugo generator tag on the home page. + if n, ok := d.(*Node); ok && n.IsHome { + if !viper.GetBool("DisableHugoGeneratorInject") { + transformLinks = append(transformLinks, transform.HugoGeneratorInject) + } + } + var path []byte if viper.GetBool("RelativeURLs") { |