Skip to content

Commit c7d5f9f

Browse files
authored
resources: Register MediaTypes before build
Fixes gohugoio#9971
1 parent bfebd8c commit c7d5f9f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Diff for: commands/hugo.go

+6
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ func initializeConfig(mustHaveConfigFile, failOnInitErr, running bool,
127127
return nil, err
128128
}
129129

130+
if h := c.hugoTry(); h != nil {
131+
for _, s := range h.Sites {
132+
s.RegisterMediaTypes()
133+
}
134+
}
135+
130136
return c, nil
131137
}
132138

Diff for: commands/server.go

-4
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,6 @@ func (sc *serverCmd) server(cmd *cobra.Command, args []string) error {
272272
return err
273273
}
274274

275-
for _, s := range c.hugo().Sites {
276-
s.RegisterMediaTypes()
277-
}
278-
279275
// Watch runs its own server as part of the routine
280276
if sc.serverWatch {
281277

0 commit comments

Comments
 (0)