{"record":{"id":"5bd6ad05b8370e97","repo":"gohugoio/hugo","slug":"no-alias-template-found","errorCode":null,"errorMessage":"no alias template found","messagePattern":"no alias template found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hugolib/alias.go","lineNumber":70,"sourceCode":"\tvar base string = \"\"\n\tif ps, ok := p.(*pageState); ok {\n\t\tbase, templateDesc = ps.GetInternalTemplateBasePathAndDescriptor()\n\t}\n\ttemplateDesc.LayoutFromUser = \"\"\n\ttemplateDesc.Kind = \"\"\n\ttemplateDesc.OutputFormat = output.AliasHTMLFormat.Name\n\ttemplateDesc.MediaType = output.AliasHTMLFormat.MediaType.Type\n\n\tq := tplimpl.TemplateQuery{\n\t\tPath:     base,\n\t\tCategory: tplimpl.CategoryLayout,\n\t\tDesc:     templateDesc,\n\t\tSites:    matrix,\n\t}\n\n\tt := a.ts.LookupPagesLayout(q)\n\tif t == nil {\n\t\treturn nil, errors.New(\"no alias template found\")\n\t}\n\n\tif p == nil {\n\t\tp = page.NopPage\n\t}\n\n\tdata := aliasPage{\n\t\tpermalink,\n\t\tp,\n\t}\n\n\tctx := a.ts.PrepareTopLevelRenderCtx(context.Background(), p)\n\n\tbuffer := new(bytes.Buffer)\n\terr := a.ts.ExecuteWithContext(ctx, t, buffer, data)\n\tif err != nil {\n\t\treturn nil, err\n\t}","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/hugolib/alias.go#L52-L88","documentation":"renderAlias looks up the alias HTML layout (output.AliasHTMLFormat) via the template store. If no matching alias template is found in any resolved layout location, it errors. Hugo ships a built-in default alias template, so in practice this indicates the template system was unable to resolve it — e.g. an unusual layout/output-format configuration or a descriptor that does not match the alias template.","triggerScenarios":"A page that emits aliases while the alias layout cannot be resolved because of custom layout overrides, disabled HTML output format, or a template descriptor mismatch.","commonSituations":"Overriding layouts in a way that removes the default alias template; disabling or misconfiguring the HTML output format for aliased pages; theme/layouts conflicts that hide the alias template.","solutions":["Ensure the built-in alias template is available (avoid deleting/overriding layouts that supply alias.html).","Check that HTML output format is enabled for the relevant pages.","Review custom layout/outputFormat settings that change the descriptor used to look up the alias template."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Ensure HTML output and an alias template are available before relying on aliases\nif !outputFormatEnabled(\"HTML\") {\n    return errors.New(\"HTML output format must be enabled for aliases\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not delete/override the default alias template.","Keep the HTML output format enabled for aliased pages.","Review custom layout/outputFormat settings that change the alias template descriptor."],"tags":["hugo","template","alias","render"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}