mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Add hugo.IsMultiHost
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
ada3fceea8
commit
1f48b717c7
@@ -111,11 +111,17 @@ func (i HugoInfo) Deps() []*Dependency {
|
||||
return i.deps
|
||||
}
|
||||
|
||||
// IsMultiHost reports whether each configured language has a unique baseURL.
|
||||
func (i HugoInfo) IsMultiHost() bool {
|
||||
return i.conf.IsMultihost()
|
||||
}
|
||||
|
||||
// ConfigProvider represents the config options that are relevant for HugoInfo.
|
||||
type ConfigProvider interface {
|
||||
Environment() string
|
||||
Running() bool
|
||||
WorkingDir() string
|
||||
IsMultihost() bool
|
||||
}
|
||||
|
||||
// NewInfo creates a new Hugo Info object.
|
||||
|
@@ -68,6 +68,7 @@ type testConfig struct {
|
||||
environment string
|
||||
running bool
|
||||
workingDir string
|
||||
multihost bool
|
||||
}
|
||||
|
||||
func (c testConfig) Environment() string {
|
||||
@@ -81,3 +82,7 @@ func (c testConfig) Running() bool {
|
||||
func (c testConfig) WorkingDir() string {
|
||||
return c.workingDir
|
||||
}
|
||||
|
||||
func (c testConfig) IsMultihost() bool {
|
||||
return c.multihost
|
||||
}
|
||||
|
Reference in New Issue
Block a user