Skip to content

Commit cf98624

Browse files
authored
content: Update templates.Defer note
1 parent ab51fdc commit cf98624

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎content/en/functions/templates/Defer.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ aliases: [/functions/templates.defer]
1414
{{< new-in 0.128.0 />}}
1515

1616
> [!note]
17-
> This feature is meant to be used in the main page layout files/templates, and has undefined behavior when used from shortcodes, partials, or render hook templates. See [this issue](https://github.com/gohugoio/hugo/issues/13492#issuecomment-2734700391) for more info.
17+
> This feature should only be used in the main page template, typically `layouts/baseof.html`. Using it in shortcodes, partials, or render hook templates may lead to unpredictable results. For further details, please refer to [this issue].
18+
19+
[this issue]: https://github.com/gohugoio/hugo/issues/13492#issuecomment-2734700391
1820

1921
In some rare use cases, you may need to defer the execution of a template until after all sites and output formats have been rendered. One such example could be [TailwindCSS](/functions/css/tailwindcss/) using the output of [hugo_stats.json](/configuration/build/) to determine which classes and other HTML identifiers are being used in the final output:
2022

0 commit comments

Comments
 (0)