Skip to content

Commit

Permalink
resources: Register MediaTypes before build
Browse files Browse the repository at this point in the history
Fixes #9971
  • Loading branch information
vanbroup committed Jun 3, 2022
1 parent bfebd8c commit c7d5f9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 6 additions & 0 deletions commands/hugo.go
Expand Up @@ -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
}

Expand Down
4 changes: 0 additions & 4 deletions commands/server.go
Expand Up @@ -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 {

Expand Down

0 comments on commit c7d5f9f

Please sign in to comment.