{"record":{"id":"736047e385a8ff2f","repo":"gohugoio/hugo","slug":"rst-s","errorCode":null,"errorMessage":"rst: %s","messagePattern":"rst: %s","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"markup/markup_config/config.go","lineNumber":55,"sourceCode":"\t// Table of contents configuration\n\tTableOfContents tableofcontents.Config\n\n\t// Configuration for the Goldmark markdown engine.\n\tGoldmark goldmark_config.Config\n\n\t// Configuration for the AsciiDoc external markdown engine.\n\tAsciiDocExt asciidocext_config.Config\n\n\t// Configuration for the reStructuredText external markdown engine.\n\tRST rst_config.Config\n}\n\nfunc (c *Config) Init() error {\n\tif err := c.Goldmark.Init(); err != nil {\n\t\treturn fmt.Errorf(\"goldmark: %s\", err)\n\t}\n\tif err := c.RST.Init(); err != nil {\n\t\treturn fmt.Errorf(\"rst: %s\", err)\n\t}\n\treturn nil\n}\n\nfunc Decode(cfg config.Provider) (conf Config, err error) {\n\tconf = Default\n\n\tm := cfg.GetStringMap(\"markup\")\n\tif m == nil {\n\t\treturn\n\t}\n\tm = hmaps.CleanConfigStringMap(m)\n\n\tnormalizeConfig(m)\n\n\terr = mapstructure.WeakDecode(m, &conf)\n\tif err != nil {\n\t\treturn","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/markup/markup_config/config.go#L37-L73","documentation":"Thrown by markup_config.Config.Init() when c.RST.Init() fails, prepending 'rst:' via %s (not %w, so the cause is not unwrappable). RST.Init() validates the syntaxHighlight field, so in practice this error is almost always the wrapped form of error 444 ('invalid value for syntaxHighlight'). It surfaces during markup config decode at startup.","triggerScenarios":"Setting [markup.rst] syntaxHighlight to anything other than \"short\", \"long\", or \"none\" in hugo.toml/yaml/json. Fires from markup_config.Decode -> Config.Init during Hugo bootstrap.","commonSituations":"Copying an RST config snippet from an outdated tutorial that uses a value like \"html\" or \"html5\"; typo such as 'Long' (capitalized) or 'short ' (trailing space); confusing the rst syntaxHighlight knob with Hugo's general code highlighter config.","solutions":["Set [markup.rst] syntaxHighlight to one of: \"short\", \"long\" (default), or \"none\".","Remove the [markup.rst] block to accept the default \"long\".","Re-run `hugo` to confirm the config loads."],"exampleFix":"# before\n[markup.rst]\n  syntaxHighlight = \"html5\"\n\n# after\n[markup.rst]\n  syntaxHighlight = \"short\"","handlingStrategy":"validation","validationCode":"// Pre-validate RST config before Decode/Init.\nfunc validateRST(syntaxHighlight string) error {\n    switch syntaxHighlight {\n    case \"\", \"short\", \"long\", \"none\":\n        return nil\n    }\n    return fmt.Errorf(\"rst.syntaxHighlight %q must be short|long|none\", syntaxHighlight)\n}","typeGuard":null,"tryCatchPattern":"if err := markupCfg.Init(); err != nil {\n    if strings.HasPrefix(err.Error(), \"rst:\") {\n        // point user at the [markup.rst] syntaxHighlight value\n    }\n    return err\n}","preventionTips":["Treat syntaxHighlight as an enum of three values; document it in your config with a comment.","Unit-test config decode against your hugo.toml in CI."],"tags":["config","markup","rst","validation"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}