Add Hugo generator tag to home page if not present

Fixes #2182
This commit is contained in:
Bjørn Erik Pedersen
2016-06-04 13:45:56 +02:00
committed by Steve Francia
parent 80ebe0578a
commit a7f51703c4
3 changed files with 111 additions and 0 deletions

View File

@@ -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") {