diff --git a/commands/hugo.go b/commands/hugo.go index c61e64185..f10fec00b 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -127,6 +127,12 @@ func initializeConfig(mustHaveConfigFile, failOnInitErr, running bool, return nil, err } + if h := c.hugoTry(); h != nil { + for _, s := range h.Sites { + s.RegisterMediaTypes() + } + } + return c, nil } diff --git a/commands/server.go b/commands/server.go index ff8fe4cd2..f082164ce 100644 --- a/commands/server.go +++ b/commands/server.go @@ -272,10 +272,6 @@ func (sc *serverCmd) server(cmd *cobra.Command, args []string) error { return err } - for _, s := range c.hugo().Sites { - s.RegisterMediaTypes() - } - // Watch runs its own server as part of the routine if sc.serverWatch {