1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

Add hugo.IsProduction function

Fixes #6873
This commit is contained in:
Joshua Wong
2020-02-26 00:58:07 +08:00
committed by GitHub
parent d184e5059c
commit 1352bc880d
3 changed files with 11 additions and 2 deletions

View File

@@ -54,6 +54,10 @@ func (i Info) Generator() template.HTML {
return template.HTML(fmt.Sprintf(`<meta name="generator" content="Hugo %s" />`, CurrentVersion.String()))
}
func (i Info) IsProduction() bool {
return i.Environment == EnvironmentProduction
}
// NewInfo creates a new Hugo Info object.
func NewInfo(environment string) Info {
if environment == "" {