Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-04-11 09:39:39 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-04-11 10:50:19 +0300
commitb110d0ae04e13fb45c739bcebb580709745082e6 (patch)
tree7db6bfde65008ec29bdc87746f3201c1615c8a13 /commands/server.go
parent73825cfc1c0b007830b24bb1947a565175b52d36 (diff)
commands: Remove the Hugo global
There are still some cleaning to do, but that felt good. See #4598
Diffstat (limited to 'commands/server.go')
-rw-r--r--commands/server.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/commands/server.go b/commands/server.go
index 775aa402d..6ede49417 100644
--- a/commands/server.go
+++ b/commands/server.go
@@ -39,8 +39,6 @@ import (
)
type serverCmd struct {
- hugoBuilderCommon
-
disableLiveReload bool
navigateToChanged bool
renderToDisk bool
@@ -53,13 +51,13 @@ type serverCmd struct {
disableFastRender bool
- *baseCmd
+ *baseBuilderCmd
}
func newServerCmd() *serverCmd {
cc := &serverCmd{}
- cc.baseCmd = newBaseCmd(&cobra.Command{
+ cc.baseBuilderCmd = newBuilderCmd(&cobra.Command{
Use: "server",
Aliases: []string{"serve"},
Short: "A high performance webserver",
@@ -232,7 +230,7 @@ func (s *serverCmd) server(cmd *cobra.Command, args []string) error {
return err
}
- for _, s := range Hugo.Sites {
+ for _, s := range c.hugo.Sites {
s.RegisterMediaTypes()
}
@@ -345,7 +343,7 @@ func (f *fileServer) createEndpoint(i int) (*http.ServeMux, string, string, erro
// TODO(bep) cli refactor
func (c *commandeer) serve(s *serverCmd) error {
- isMultiHost := Hugo.IsMultihost()
+ isMultiHost := c.hugo.IsMultihost()
var (
baseURLs []string
@@ -353,12 +351,12 @@ func (c *commandeer) serve(s *serverCmd) error {
)
if isMultiHost {
- for _, s := range Hugo.Sites {
+ for _, s := range c.hugo.Sites {
baseURLs = append(baseURLs, s.BaseURL.String())
roots = append(roots, s.Language.Lang)
}
} else {
- s := Hugo.Sites[0]
+ s := c.hugo.Sites[0]
baseURLs = []string{s.BaseURL.String()}
roots = []string{""}
}