{"record":{"id":"d5fae92ee78999dc","repo":"gohugoio/hugo","slug":"no-compatible-template-found-for-shortcode-q-in","errorCode":null,"errorMessage":"no compatible template found for shortcode %q in %s","messagePattern":"no compatible template found for shortcode %q in (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"tpl/tplimpl/templatestore.go","lineNumber":693,"sourceCode":"\t\t\tweight := s.dh.compareDescriptors(q.Category, q.Desc, k, q.Sites, vv.matrix)\n\t\t\tweight.distance = distance\n\t\t\tisBetter := best.isBetter(weight, vv)\n\t\t\tif isBetter {\n\t\t\t\tbest.updateValues(weight, k2, k, vv)\n\t\t\t}\n\t\t}\n\n\t\treturn false, nil\n\t})\n\n\tif best.w.w1 <= 0 {\n\t\tvar err error\n\t\tif s := best.candidatesAsStringSlice(); s != nil {\n\t\t\tmsg := fmt.Sprintf(\"no compatible template found for shortcode %q in %s\", q.Name, s)\n\t\t\tif !q.Desc.IsPlainText {\n\t\t\t\tmsg += \"; note that to use plain text template shortcodes in HTML you need to use the shortcode {{% delimiter\"\n\t\t\t}\n\t\t\terr = errors.New(msg)\n\t\t} else {\n\t\t\terr = fmt.Errorf(\"no template found for shortcode %q\", q.Name)\n\t\t}\n\t\treturn nil, err\n\t}\n\n\treturn best.templ, nil\n}\n\n// PrintDebug is for testing/debugging only.\nfunc (s *TemplateStore) PrintDebug(prefix string, category Category, w io.Writer) {\n\tif w == nil {\n\t\tw = os.Stdout\n\t}\n\n\tprintOne := func(key string, vv *TemplInfo) {\n\t\tlevel := strings.Count(key, \"/\")\n\t\tif category != vv.category {","sourceCodeStart":675,"sourceCodeEnd":711,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/tpl/tplimpl/templatestore.go#L675-L711","documentation":"Thrown by TemplateStore when a shortcode referenced in content has candidate templates but none are compatible with the requested category/descriptor after scoring (tpl/tplimpl/templatestore.go:686-693). A common sub-cause is using an HTML shortcode delimiter for a plain-text-only template, which appends the hint about {{% delimiters.","triggerScenarios":"Content uses {{< mycode >}} but only a plain-text shortcode template (layouts/shortcodes/mycode.html written for {{% }}) exists; or category/output-format/overlay/site filters exclude every candidate.","commonSituations":"Theme update that renamed or removed a shortcode; site overlay partially overriding a shortcode; mismatched base vs language template; wrong delimiter for the template type; plain-text shortcode used in HTML context without {{% }}.","solutions":["Check the shortcode name spelling in the content file matches a file under layouts/shortcodes/.","If the template is plain-text, invoke with the {{% %}} delimiter instead of {{< >}}.","Add the missing shortcode template or remove the call from content.","If using overlays/multi-site, verify the template is present for the relevant site/language and output format."],"exampleFix":"// before\n{{< myshortcode >}}\n// after (for a plain-text shortcode)\n{{% myshortcode %}}","handlingStrategy":"validation","validationCode":"{{/* Ensure shortcode name matches a layouts/shortcodes/<name>.html file */}}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep shortcode names aligned with filenames under layouts/shortcodes/.","Use {{% %}} delimiters for plain-text shortcodes in HTML context.","After theme updates, verify referenced shortcodes still ship."],"tags":["template","shortcode","rendering","lookup","hugo"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}