diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2021-04-09 08:28:27 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2021-04-09 08:28:27 +0300 |
commit | 7fdd2b95e20f322b0a47f63ff1010a04f47ce67b (patch) | |
tree | 8d1ad329364ec24e74c14cabe9a67f40c2f76b7d /common | |
parent | 3d5dbdcb1a11b059fc2f93ed6fadb9009bf72673 (diff) |
Add hugo.IsExtended
Fixes #8399
Diffstat (limited to 'common')
-rw-r--r-- | common/hugo/hugo.go | 4 | ||||
-rw-r--r-- | common/hugo/hugo_test.go | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/common/hugo/hugo.go b/common/hugo/hugo.go index 67e8e40a6..1aae80776 100644 --- a/common/hugo/hugo.go +++ b/common/hugo/hugo.go @@ -71,6 +71,10 @@ func (i Info) IsProduction() bool { return i.Environment == EnvironmentProduction } +func (i Info) IsExtended() bool { + return IsExtended +} + // NewInfo creates a new Hugo Info object. func NewInfo(environment string) Info { if environment == "" { diff --git a/common/hugo/hugo_test.go b/common/hugo/hugo_test.go index 0862f36e7..0631be62c 100644 --- a/common/hugo/hugo_test.go +++ b/common/hugo/hugo_test.go @@ -32,6 +32,7 @@ func TestHugoInfo(t *testing.T) { c.Assert(hugoInfo.Environment, qt.Equals, "production") c.Assert(string(hugoInfo.Generator()), qt.Contains, fmt.Sprintf("Hugo %s", hugoInfo.Version())) c.Assert(hugoInfo.IsProduction(), qt.Equals, true) + c.Assert(hugoInfo.IsExtended(), qt.Equals, IsExtended) devHugoInfo := NewInfo("development") c.Assert(devHugoInfo.IsProduction(), qt.Equals, false) |