{"id":"f0bfe53d33895775","repo":"gohugoio/hugo","slug":"project-config-markup-goldmark-renderhooks-image-u","errorCode":null,"errorMessage":"project config markup.goldmark.renderHooks.image.useEmbedded must be one of %s","messagePattern":"project config markup\\.goldmark\\.renderHooks\\.image\\.useEmbedded must be one of (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/allconfig/allconfig.go","lineNumber":494,"sourceCode":"\tif c.Markup.Goldmark.RenderHooks.Link.EnableDefault != nil {\n\t\talternative := \"Use markup.goldmark.renderHooks.link.useEmbedded instead.\" + \" \" + alternativeDetails\n\t\thugo.DeprecateWithLogger(\"project config key markup.goldmark.renderHooks.link.enableDefault\", alternative, \"0.148.0\", logger.Logger())\n\t\tif *c.Markup.Goldmark.RenderHooks.Link.EnableDefault {\n\t\t\tc.Markup.Goldmark.RenderHooks.Link.UseEmbedded = gc.RenderHookUseEmbeddedFallback\n\t\t} else {\n\t\t\tc.Markup.Goldmark.RenderHooks.Link.UseEmbedded = gc.RenderHookUseEmbeddedNever\n\t\t}\n\t}\n\n\t// Validate render hook configuration.\n\trenderHookUseEmbeddedModes := []string{\n\t\tgc.RenderHookUseEmbeddedAlways,\n\t\tgc.RenderHookUseEmbeddedAuto,\n\t\tgc.RenderHookUseEmbeddedFallback,\n\t\tgc.RenderHookUseEmbeddedNever,\n\t}\n\tif !slices.Contains(renderHookUseEmbeddedModes, c.Markup.Goldmark.RenderHooks.Image.UseEmbedded) {\n\t\treturn fmt.Errorf(\"project config markup.goldmark.renderHooks.image.useEmbedded must be one of %s\", helpers.StringSliceToList(renderHookUseEmbeddedModes, \"or\"))\n\t}\n\tif !slices.Contains(renderHookUseEmbeddedModes, c.Markup.Goldmark.RenderHooks.Link.UseEmbedded) {\n\t\treturn fmt.Errorf(\"project config markup.goldmark.renderHooks.link.useEmbedded must be one of %s\", helpers.StringSliceToList(renderHookUseEmbeddedModes, \"or\"))\n\t}\n\n\tc.C = &ConfigCompiled{\n\t\tTimeout:             timeout,\n\t\tBaseURL:             baseURL,\n\t\tBaseURLLiveReload:   baseURL,\n\t\tDisabledKinds:       disabledKinds,\n\t\tDisabledLanguages:   disabledLangs,\n\t\tIgnoredLogs:         ignoredLogIDs,\n\t\tKindOutputFormats:   kindOutputFormats,\n\t\tDefaultOutputFormat: defaultOutputFormat,\n\t\tCreateTitle:         helpers.GetTitleFunc(c.TitleCaseStyle),\n\t\tIsUglyURLSection:    isUglyURL,\n\t\tIgnoreFile:          ignoreFile,\n\t\tMainSections:        c.MainSections,","sourceCodeStart":476,"sourceCodeEnd":512,"githubUrl":"https://github.com/gohugoio/hugo/blob/8a468df065a75c1c7cf9f6850f32148746590ea5/config/allconfig/allconfig.go#L476-L512","documentation":"Hugo validates `markup.goldmark.renderHooks.image.useEmbedded`, which controls when Hugo's embedded image render hook is used versus a user/theme-provided one. The value must be one of the defined modes (always, auto, fallback, never); anything else aborts config compilation. Legacy boolean `enableDefault` values are converted before this check, so only genuinely unknown strings reach it.","triggerScenarios":"Setting `[markup.goldmark.renderHooks.image] useEmbedded = \"true\"` (string boolean), a typo like \"fallbck\", or any value outside the allowed set in site, theme, or module config.","commonSituations":"Migrating from the deprecated `enableDefault` boolean and writing \"true\"/\"false\" as strings instead of the new mode names; copying config snippets from outdated blog posts.","solutions":["Set the value to one of: \"always\", \"auto\", \"fallback\", or \"never\".","If migrating from `enableDefault = true`, use `useEmbedded = \"fallback\"` (embedded hook used when no user hook exists).","Check merged config with `hugo config` if the bad value comes from a theme or module."],"exampleFix":"# before\n[markup.goldmark.renderHooks.image]\nuseEmbedded = \"true\"\n# after\n[markup.goldmark.renderHooks.image]\nuseEmbedded = \"fallback\"","handlingStrategy":"validation","validationCode":"allowed := map[string]bool{\"auto\": true, \"always\": true, \"fallback\": true, \"never\": true}\nif v := cfg.Markup.Goldmark.RenderHooks.Image.UseEmbedded; v != \"\" && !allowed[v] {\n    return fmt.Errorf(\"markup.goldmark.renderHooks.image.useEmbedded %q not in auto|always|fallback|never\", v)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only the documented enum values (auto, always, fallback, never), not booleans like true/false","Copy the setting name and value from current Hugo docs — this option changed shape across versions","Validate enum config fields against an allowlist at startup"],"tags":["hugo","config","goldmark","render-hooks","markdown"],"analyzedSha":"8a468df065a75c1c7cf9f6850f32148746590ea5","analyzedAt":"2026-07-31T21:23:07.045Z","schemaVersion":2}