mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-13 12:14:49 +00:00
1 parent
3c405f5172
commit
5714531f34
1 file changed
+14
-10
+14
-10
@@ -1893,18 +1893,22 @@ func (s *Site) renderAndWritePage(name string, dest string, p *PageOutput, layou
|
||||
|
||||
transformLinks := transform.NewEmptyTransforms()
|
||||
|
||||
if s.Info.relativeURLs || s.Info.canonifyURLs {
|
||||
transformLinks = append(transformLinks, transform.AbsURL)
|
||||
}
|
||||
isHTML := p.outputFormat.IsHTML
|
||||
|
||||
if s.running() && s.Cfg.GetBool("watch") && !s.Cfg.GetBool("disableLiveReload") {
|
||||
transformLinks = append(transformLinks, transform.LiveReloadInject(s.Cfg.GetInt("port")))
|
||||
}
|
||||
if isHTML {
|
||||
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 p.IsHome() {
|
||||
if !s.Cfg.GetBool("disableHugoGeneratorInject") {
|
||||
transformLinks = append(transformLinks, transform.HugoGeneratorInject)
|
||||
if s.running() && s.Cfg.GetBool("watch") && !s.Cfg.GetBool("disableLiveReload") {
|
||||
transformLinks = append(transformLinks, transform.LiveReloadInject(s.Cfg.GetInt("port")))
|
||||
}
|
||||
|
||||
// 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user