mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
commands: Remove the Hugo global
There are still some cleaning to do, but that felt good. See #4598
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user