common/hugo: Add hugo.IsServer and hugo.IsDevelopment

And deprecate site.IsServer.

Closes #11510
This commit is contained in:
Joe Mooring
2023-09-29 10:23:08 -07:00
committed by Bjørn Erik Pedersen
parent 274852bcf2
commit d1b4458536
7 changed files with 41 additions and 6 deletions

View File

@@ -356,7 +356,9 @@ func newHugoSitesNew(cfg deps.DepsCfg, d *deps.Deps, sites []*Site) (*HugoSites,
}
// Returns true if we're running in a server.
// Deprecated: use hugo.IsServer instead
func (s *Site) IsServer() bool {
helpers.Deprecated(".Site.IsServer", "Use hugo.IsServer instead.", false)
return s.conf.Internal.Running
}