{"id":"17da55d876e97ee4","repo":"gohugoio/hugo","slug":"project-config-markup-goldmark-renderhooks-link-us","errorCode":null,"errorMessage":"project config markup.goldmark.renderHooks.link.useEmbedded must be one of %s","messagePattern":"project config markup\\.goldmark\\.renderHooks\\.link\\.useEmbedded must be one of (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/allconfig/allconfig.go","lineNumber":497,"sourceCode":"\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,\n\t\tClock:               clock,\n\t\tHTTPCache:           httpCache,\n\t\ttransientErr:        transientErr,","sourceCodeStart":479,"sourceCodeEnd":515,"githubUrl":"https://github.com/gohugoio/hugo/blob/8a468df065a75c1c7cf9f6850f32148746590ea5/config/allconfig/allconfig.go#L479-L515","documentation":"Identical validation to error 67 but for the link render hook: `markup.goldmark.renderHooks.link.useEmbedded` chooses when Hugo's embedded link render hook applies and must be one of the defined modes (always, auto, fallback, never). Invalid values fail config compilation immediately.","triggerScenarios":"Setting `[markup.goldmark.renderHooks.link] useEmbedded` to a string outside the allowed set — a typo, a string boolean, or a stale value from old documentation.","commonSituations":"Same migration pitfall as the image hook: converting the deprecated `enableDefault` boolean into string \"true\"/\"false\" instead of a mode name; theme configs written for older Hugo versions.","solutions":["Use one of \"always\", \"auto\", \"fallback\", or \"never\".","For old `enableDefault = true` behavior, use `useEmbedded = \"fallback\"`.","Inspect `hugo config` output to find which config file supplies the invalid value."],"exampleFix":"# before\n[markup.goldmark.renderHooks.link]\nuseEmbedded = \"yes\"\n# after\n[markup.goldmark.renderHooks.link]\nuseEmbedded = \"auto\"","handlingStrategy":"validation","validationCode":"allowed := map[string]bool{\"auto\": true, \"always\": true, \"fallback\": true, \"never\": true}\nif v := cfg.Markup.Goldmark.RenderHooks.Link.UseEmbedded; v != \"\" && !allowed[v] {\n    return fmt.Errorf(\"markup.goldmark.renderHooks.link.useEmbedded %q not in auto|always|fallback|never\", v)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Same enum as the image hook: auto, always, fallback, never — don't set booleans","Keep image and link hook settings consistent and validated together","Fail fast in your own config layer instead of letting Hugo's load reject it later"],"tags":["hugo","config","goldmark","render-hooks","markdown"],"analyzedSha":"8a468df065a75c1c7cf9f6850f32148746590ea5","analyzedAt":"2026-07-31T21:23:07.045Z","schemaVersion":2}