mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
common/hugo: Add hugo.IsServer and hugo.IsDevelopment
And deprecate site.IsServer. Closes #11510
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
274852bcf2
commit
d1b4458536
@@ -56,6 +56,7 @@ type Site interface {
|
||||
Home() Page
|
||||
|
||||
// Returns true if we're running in a server.
|
||||
// Deprecated: use hugo.IsServer instead
|
||||
IsServer() bool
|
||||
|
||||
// Returns the server port.
|
||||
@@ -211,6 +212,7 @@ func (s *siteWrapper) Home() Page {
|
||||
return s.s.Home()
|
||||
}
|
||||
|
||||
// Deprecated: use hugo.IsServer instead
|
||||
func (s *siteWrapper) IsServer() bool {
|
||||
return s.s.IsServer()
|
||||
}
|
||||
@@ -383,6 +385,7 @@ func (t testSite) GetIdentity() identity.Identity {
|
||||
return identity.KeyValueIdentity{Key: "site", Value: t.l.Lang}
|
||||
}
|
||||
|
||||
// Deprecated: use hugo.IsServer instead
|
||||
func (t testSite) IsServer() bool {
|
||||
return false
|
||||
}
|
||||
|
Reference in New Issue
Block a user