{"record":{"id":"3f03c40c102ebdce","repo":"gohugoio/hugo","slug":"timed-out-rendering-the-page-content-extend-the","errorCode":null,"errorMessage":"timed out rendering the page content. Extend the `timeout` limit in your Hugo config file: %w","messagePattern":"timed out rendering the page content\\. Extend the `timeout` limit in your Hugo config file: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hugolib/page__content.go","lineNumber":825,"sourceCode":"\n\t\t// TODO(bep) is set in a test. Fix that.\n\t\tif result.fuzzyWordCount == 0 {\n\t\t\tresult.fuzzyWordCount = (result.wordCount + 100) / 100 * 100\n\t\t}\n\n\t\tif isCJKLanguage {\n\t\t\tresult.readingTime = (result.wordCount + 500) / 501\n\t\t} else {\n\t\t\tresult.readingTime = (result.wordCount + 212) / 213\n\t\t}\n\n\t\trs.Value = result\n\n\t\treturn rs, nil\n\t})\n\tif err != nil {\n\t\tif herrors.IsTimeoutError(err) {\n\t\t\terr = fmt.Errorf(\"timed out rendering the page content. Extend the `timeout` limit in your Hugo config file: %w\", err)\n\t\t}\n\t\treturn contentPlainPlainWords{}, err\n\t}\n\treturn v.Value, nil\n}\n\ntype cachedContentScope struct {\n\t*cachedContent\n\tpco   *pageContentOutput\n\tscope string\n}\n\nfunc (c *cachedContentScope) prepareContext(ctx context.Context) context.Context {\n\t// A regular page's shortcode etc. may be rendered by e.g. the home page,\n\t// so we need to track any changes to this content's page.\n\tctx = tpl.Context.DependencyManagerScopedProvider.Set(ctx, c.pco.po.p)\n\n\t// The markup scope is recursive, so if already set to a non zero value, preserve that value.","sourceCodeStart":807,"sourceCodeEnd":843,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/hugolib/page__content.go#L807-L843","documentation":"Returned from the plain-summary/word-count computation (page__content.go:825) when the page-content render step was killed by Hugo's timeout and the error is recognized as a timeout (herrors.IsTimeoutError). It tells the author that rendering the page exceeded the configured `timeout` and that the limit is raised in config rather than in code.","triggerScenarios":"Rendering a page's content (including shortcode expansion and the content converter) takes longer than the configured timeout. Common with heavy math rendering, very large pages, recursive/looping shortcodes, or a slow external markup converter called inside the page.","commonSituations":"A page with hundreds of LaTeX blocks via transform.ToMath; an accidental near-infinite shortcode loop; an external converter (pandoc/asciidoctor) hanging; a watchdog too tight for a large corpus.","solutions":["Raise the timeout in config: `timeout = \"120s\"` (hugo.toml) under the root.","Identify and optimize the slow page (the page path is in the surrounding context).","If a shortcode is looping, break the recursion.","For external converters, ensure they start fast (cold-start penalty) or pre-warm them."],"exampleFix":"// before (hugo.toml)\ntimeout = \"30s\"\n\n// after\ntimeout = \"120s\"","handlingStrategy":"validation","validationCode":"// library use: set a timeout proportional to your largest page\n// cfg.Timeout = 2 * time.Minute  (or hugo.toml: timeout = \"120s\")","typeGuard":null,"tryCatchPattern":"if err := pageContent(); err != nil {\n    var te interface{ Timeout() bool }\n    if errors.As(err, &te) && te.Timeout() { /* raise limit / optimize page */ }\n}","preventionTips":["Set `timeout` generously for large math-heavy sites.","Profile slow pages and cache expensive transforms.","Avoid near-recursive shortcodes."],"tags":["timeout","render","config","performance"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}