{"id":"fd608f7217ab5493","repo":"gohugoio/hugo","slug":"goldmark-s","errorCode":null,"errorMessage":"goldmark: %s","messagePattern":"goldmark: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"markup/markup_config/config.go","lineNumber":52,"sourceCode":"\t// The configuration used by code highlighters.\n\tHighlight highlight.Config\n\n\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","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/gohugoio/hugo/blob/8a468df065a75c1c7cf9f6850f32148746590ea5/markup/markup_config/config.go#L34-L70","documentation":"`markup_config.Config.Init` initializes each markup engine's sub-config and wraps any Goldmark configuration error with the \"goldmark:\" prefix. It's a pass-through wrapper: the real cause is whatever `Goldmark.Init()` rejected in the `markup.goldmark` section of the site configuration, surfaced at config-load time before the build starts.","triggerScenarios":"Loading a site config whose `[markup.goldmark]` tree contains an invalid value that Goldmark's own Init rejects — for example an invalid `renderHooks`/extension setting or an enum-style option outside its allowed values. The exact inner message follows the \"goldmark:\" prefix.","commonSituations":"Hand-edited hugo.toml with a typo'd or out-of-range goldmark option; upgrading Hugo across versions where goldmark config keys were renamed or validation tightened; copying goldmark snippets from docs for a newer Hugo release into an older one.","solutions":["Read the wrapped message after \"goldmark:\" — it names the actual invalid option — and fix that key in the [markup.goldmark] config section.","Compare your [markup.goldmark] block against the current Hugo docs for your installed version.","Temporarily remove the [markup.goldmark] section to confirm the defaults load, then reintroduce keys one at a time."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// validate the goldmark section shape before building\nvar mc markup_config.Config\nif err := mapstructure.WeakDecode(v.GetStringMap(\"markup\"), &mc); err != nil {\n    return fmt.Errorf(\"invalid [markup] config: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"cfg, err := markup_config.Decode(v)\nif err != nil {\n    // wrapped as \"goldmark: ...\" — report the offending markup.goldmark key and abort the build\n    return fmt.Errorf(\"site config error: %w\", err)\n}","preventionTips":["Keep [markup.goldmark] keys matched to the documented schema (renderer, parser, extensions)","Check key spelling and value types — booleans vs strings are a common mismatch","Run `hugo config markup` to inspect the effective merged config after changes"],"tags":["hugo","goldmark","config","validation","markdown"],"analyzedSha":"8a468df065a75c1c7cf9f6850f32148746590ea5","analyzedAt":"2026-07-31T21:23:07.045Z","schemaVersion":2}