commands: Remove the Hugo global

There are still some cleaning to do, but that felt good.

See #4598
This commit is contained in:
Bjørn Erik Pedersen
2018-04-11 08:39:39 +02:00
parent 73825cfc1c
commit b110d0ae04
6 changed files with 41 additions and 34 deletions

View File

@@ -109,15 +109,15 @@ func (n *newCmd) newContent(cmd *cobra.Command, args []string) error {
return nil, err
}
if err := Hugo.Build(hugolib.BuildCfg{SkipRender: true}); err != nil {
if err := c.hugo.Build(hugolib.BuildCfg{SkipRender: true}); err != nil {
return nil, err
}
s = Hugo.Sites[0]
s = c.hugo.Sites[0]
if len(Hugo.Sites) > 1 {
if len(c.hugo.Sites) > 1 {
// Find the best match.
for _, ss := range Hugo.Sites {
for _, ss := range c.hugo.Sites {
if strings.Contains(createPath, "."+ss.Language.Lang) {
s = ss
break