{"record":{"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/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/config/allconfig/allconfig.go#L476-L512","documentation":"Returned by CompileConfig when markup.goldmark.renderHooks.image.useEmbedded is not one of the four allowed modes: always, auto, fallback, never. The check uses slices.Contains against the canonical constant set; any other value (including typos and the legacy boolean 'true'/'false') is rejected.","triggerScenarios":"Setting `markup.goldmark.renderHooks.image.useEmbedded = \"default\"`, `\"true\"`, `\"always-when-set\"`, or any string outside {always, auto, fallback, never}.","commonSituations":"Upgrading from a pre-0.148 config that used the boolean `enableDefault`, then manually rewriting the key and using an invalid string; or copy-pasting docs from an incompatible Hugo version.","solutions":["Set the value to one of: always, auto, fallback, never.","If migrating from enableDefault: true → fallback, false → never.","Remove the key entirely to accept the default (auto)."],"exampleFix":"// before\n[markup.goldmark.renderHooks.image]\nuseEmbedded = \"default\"\n// after\n[markup.goldmark.renderHooks.image]\nuseEmbedded = \"fallback\"","handlingStrategy":"validation","validationCode":"var useEmbeddedModes = []string{\"always\",\"auto\",\"fallback\",\"never\"}\nfunc validateImageUseEmbedded(s string) error {\n  if !slices.Contains(useEmbeddedModes, s) { return fmt.Errorf(\"useEmbedded must be one of %v\", useEmbeddedModes) }\n  return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When migrating from enableDefault, map true→fallback, false→never.","Omit the key to use the default.","Cross-check against the four canonical constants."],"tags":["config","goldmark","render-hooks","image","markup"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}