// transientErr returns the last transient error found during config compilation.
func (c *Configs) transientErr() error {
- for _, l := range c.LanguageConfigSlice {
+ for _, l := range c.LanguageConfigMap {
if l.C.transientErr != nil {
return l.C.transientErr
}
b.Assert(c.C.IsUglyURLSection("posts"), qt.IsTrue)
b.Assert(c.C.IsUglyURLSection("blog"), qt.IsFalse)
}
+
+// Issue 13199
+func TestInvalidOutputFormat(t *testing.T) {
+ t.Parallel()
+
+ files := `
+-- hugo.toml --
+disableKinds = ['page','rss','section','sitemap','taxonomy','term']
+[outputs]
+home = ['html','foo']
+-- layouts/index.html --
+x
+`
+
+ b, err := hugolib.TestE(t, files)
+ b.Assert(err, qt.IsNotNil)
+ b.Assert(err.Error(), qt.Contains, `failed to create config: unknown output format "foo" for kind "home"`)
+}