mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-02 06:48:49 -05:00
parent
3c405f5172
commit
5714531f34
1 changed files with 14 additions and 10 deletions
|
@ -1893,18 +1893,22 @@ func (s *Site) renderAndWritePage(name string, dest string, p *PageOutput, layou
|
||||||
|
|
||||||
transformLinks := transform.NewEmptyTransforms()
|
transformLinks := transform.NewEmptyTransforms()
|
||||||
|
|
||||||
if s.Info.relativeURLs || s.Info.canonifyURLs {
|
isHTML := p.outputFormat.IsHTML
|
||||||
transformLinks = append(transformLinks, transform.AbsURL)
|
|
||||||
}
|
|
||||||
|
|
||||||
if s.running() && s.Cfg.GetBool("watch") && !s.Cfg.GetBool("disableLiveReload") {
|
if isHTML {
|
||||||
transformLinks = append(transformLinks, transform.LiveReloadInject(s.Cfg.GetInt("port")))
|
if s.Info.relativeURLs || s.Info.canonifyURLs {
|
||||||
}
|
transformLinks = append(transformLinks, transform.AbsURL)
|
||||||
|
}
|
||||||
|
|
||||||
// For performance reasons we only inject the Hugo generator tag on the home page.
|
if s.running() && s.Cfg.GetBool("watch") && !s.Cfg.GetBool("disableLiveReload") {
|
||||||
if p.IsHome() {
|
transformLinks = append(transformLinks, transform.LiveReloadInject(s.Cfg.GetInt("port")))
|
||||||
if !s.Cfg.GetBool("disableHugoGeneratorInject") {
|
}
|
||||||
transformLinks = append(transformLinks, transform.HugoGeneratorInject)
|
|
||||||
|
// For performance reasons we only inject the Hugo generator tag on the home page.
|
||||||
|
if p.IsHome() {
|
||||||
|
if !s.Cfg.GetBool("disableHugoGeneratorInject") {
|
||||||
|
transformLinks = append(transformLinks, transform.HugoGeneratorInject)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue