{"id":"cdfe7a564668c78b","repo":"gohugoio/hugo","slug":"unknown-default-output-format-q","errorCode":null,"errorMessage":"unknown default output format %q","messagePattern":"unknown default output format %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/allconfig/allconfig.go","lineNumber":329,"sourceCode":"\t\t\tif isRssDisabled && format == \"rss\" {\n\t\t\t\t// Legacy config.\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tf, found := outputFormats.GetByName(format)\n\t\t\tif !found {\n\t\t\t\ttransientErr = fmt.Errorf(\"unknown output format %q for kind %q\", format, kind)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tkindOutputFormats[kind] = append(kindOutputFormats[kind], f)\n\t\t}\n\t}\n\n\tdefaultOutputFormat := outputFormats[0]\n\tc.DefaultOutputFormat = strings.ToLower(c.DefaultOutputFormat)\n\tif c.DefaultOutputFormat != \"\" {\n\t\tf, found := outputFormats.GetByName(c.DefaultOutputFormat)\n\t\tif !found {\n\t\t\treturn fmt.Errorf(\"unknown default output format %q\", c.DefaultOutputFormat)\n\t\t}\n\t\tdefaultOutputFormat = f\n\t} else {\n\t\tc.DefaultOutputFormat = defaultOutputFormat.Name\n\t}\n\n\tdisabledLangs := make(map[string]bool)\n\tfor _, lang := range c.DisableLanguages {\n\t\tdisabledLangs[lang] = true\n\t}\n\n\tfor i, s := range c.IgnoreLogs {\n\t\tc.IgnoreLogs[i] = strings.ToLower(s)\n\t}\n\n\tignoredLogIDs := make(map[string]bool)\n\tfor _, err := range c.IgnoreLogs {\n\t\tignoredLogIDs[err] = true","sourceCodeStart":311,"sourceCodeEnd":347,"githubUrl":"https://github.com/gohugoio/hugo/blob/8a468df065a75c1c7cf9f6850f32148746590ea5/config/allconfig/allconfig.go#L311-L347","documentation":"The top-level `defaultOutputFormat` setting names which output format is the primary one (used for canonical permalinks etc.). Hugo lowercases the value and looks it up in the compiled output formats; if not found, config compilation aborts. Unlike per-kind unknown formats (a transient error), this one returns immediately.","triggerScenarios":"Setting `defaultOutputFormat = \"htmll\"` or naming a custom format that isn't defined under `[outputFormats]` when `Config.CompileConfig` runs.","commonSituations":"Typos, removing a custom output format definition while leaving `defaultOutputFormat` pointing at it, or setting it in a language-specific config where the format isn't visible.","solutions":["Correct the value to an existing format name, e.g. `defaultOutputFormat = \"html\"`.","If it should be a custom format, define it under `[outputFormats]` first.","Remove the setting entirely to let Hugo default to the first configured output format."],"exampleFix":"# before\ndefaultOutputFormat = \"htlm\"\n# after\ndefaultOutputFormat = \"html\"","handlingStrategy":"validation","validationCode":"if name := cfg.DefaultOutputFormat; name != \"\" {\n    if _, found := allFormats.GetByName(name); !found {\n        return fmt.Errorf(\"defaultOutputFormat %q is not a defined output format\", name)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only set defaultOutputFormat to a format that exists in the built-in or [outputFormats] definitions","Prefer leaving defaultOutputFormat unset unless you actually need to override \"html\""],"tags":["hugo","config","output-formats"],"analyzedSha":"8a468df065a75c1c7cf9f6850f32148746590ea5","analyzedAt":"2026-07-31T21:23:07.045Z","schemaVersion":2}