tpl: Detect and fail on infinite template recursion

Fixes #13627
This commit is contained in:
Bjørn Erik Pedersen
2025-04-20 18:20:17 +02:00
parent be3b147860
commit 1408c156d8
7 changed files with 68 additions and 38 deletions

View File

@@ -850,7 +850,7 @@ func (c *cachedContentScope) contentPlain(ctx context.Context) (contentPlainPlai
})
if err != nil {
if herrors.IsTimeoutError(err) {
err = fmt.Errorf("timed out rendering the page content. You may have a circular loop in a shortcode, or your site may have resources that take longer to build than the `timeout` limit in your Hugo config file: %w", err)
err = fmt.Errorf("timed out rendering the page content. Extend the `timeout` limit in your Hugo config file: %w", err)
}
return contentPlainPlainWords{}, err
}