]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
resources: Register MediaTypes before build
authorPaul van Brouwershaven <vanbroup@users.noreply.github.com>
Fri, 3 Jun 2022 19:37:50 +0000 (21:37 +0200)
committerGitHub <noreply@github.com>
Fri, 3 Jun 2022 19:37:50 +0000 (21:37 +0200)
Fixes #9971

commands/hugo.go
commands/server.go

index c61e6418513e30d421912be8724ab67722619932..f10fec00b7cfc52d7978ae1cf6bf4904ccd3bc2f 100644 (file)
@@ -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
 }
 
index ff8fe4cd2947eabd93b1f0f279b4ef443b84a1f5..f082164cee93bbd3cf30217e620227b0933c8956 100644 (file)
@@ -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 {