summaryrefslogtreecommitdiffstats
path: root/commands/commandeer.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-11-26 10:11:22 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-12-06 14:37:25 +0100
commit831d23cb4d1ca99cdc15ed31c8ee1f981497be8f (patch)
tree8fe47b1b1b9233448297f8015ce61bbb7da13fc7 /commands/commandeer.go
parent514e18dc27ce37a0e9a231741d616cf29d50d610 (diff)
Add tpl/site and tpl/hugo
This means that the current `.Site` and ´.Hugo` is available as a globals, so you can do `site.IsServer`, `hugo.Version` etc. Fixes #5470 Fixes #5467 Fixes #5503
Diffstat (limited to 'commands/commandeer.go')
-rw-r--r--commands/commandeer.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/commands/commandeer.go b/commands/commandeer.go
index cd2866a27..b722991ab 100644
--- a/commands/commandeer.go
+++ b/commands/commandeer.go
@@ -17,10 +17,11 @@ import (
"bytes"
"errors"
- "github.com/gohugoio/hugo/common/herrors"
-
"io/ioutil"
+ "github.com/gohugoio/hugo/common/herrors"
+ "github.com/gohugoio/hugo/common/hugo"
+
jww "github.com/spf13/jwalterweatherman"
"os"
@@ -105,7 +106,7 @@ func (c *commandeer) getErrorWithContext() interface{} {
m := make(map[string]interface{})
m["Error"] = errors.New(removeErrorPrefixFromLog(c.logger.Errors()))
- m["Version"] = hugoVersionString()
+ m["Version"] = hugo.BuildVersionString()
fe := herrors.UnwrapErrorWithFileContext(c.buildErr)
if fe != nil {
@@ -379,7 +380,7 @@ func (c *commandeer) loadConfig(mustHaveConfigFile, running bool) error {
if themeVersionMismatch {
name := filepath.Base(dir)
cfg.Logger.ERROR.Printf("%s theme does not support Hugo version %s. Minimum version required is %s\n",
- strings.ToUpper(name), helpers.CurrentHugoVersion.ReleaseVersion(), minVersion)
+ strings.ToUpper(name), hugo.CurrentVersion.ReleaseVersion(), minVersion)
}
return nil