summaryrefslogtreecommitdiffstats
path: root/docs/content/en/functions/fmt/Warnf.md
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2024-06-21 09:41:24 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2024-06-21 09:41:24 +0200
commitaf0cb57aaf668278551454678eac60b17348b13c (patch)
treeb0fbd866cfc5e605ff789de9d6d9b162094a217b /docs/content/en/functions/fmt/Warnf.md
parentd5542ed286746e89fb13a1f821d4955ace371773 (diff)
parent8b9803425e63e1b1801f8d5d676e96368d706722 (diff)
downloadhugo-af0cb57aaf668278551454678eac60b17348b13c.tar.gz
hugo-af0cb57aaf668278551454678eac60b17348b13c.zip
Merge commit '8b9803425e63e1b1801f8d5d676e96368d706722'
Diffstat (limited to 'docs/content/en/functions/fmt/Warnf.md')
-rw-r--r--docs/content/en/functions/fmt/Warnf.md7
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/content/en/functions/fmt/Warnf.md b/docs/content/en/functions/fmt/Warnf.md
index 0a90251d3..f4fa22474 100644
--- a/docs/content/en/functions/fmt/Warnf.md
+++ b/docs/content/en/functions/fmt/Warnf.md
@@ -8,6 +8,7 @@ action:
related:
- functions/fmt/Errorf
- functions/fmt/Erroridf
+ - functions/fmt/Warnidf
returnType: string
signatures: ['fmt.Warnf FORMAT [INPUT]']
aliases: [/functions/warnf]
@@ -21,6 +22,8 @@ The `warnf` function evaluates the format string, then prints the result to the
{{ warnf "The %q shortcode was unable to find %s. See %s" .Name $file .Position }}
```
+Use the [`warnidf`] function to allow optional suppression of specific warnings.
+
To prevent suppression of duplicate messages when using `warnf` for debugging, make each message unique with the [`math.Counter`] function. For example:
@@ -30,4 +33,6 @@ To prevent suppression of duplicate messages when using `warnf` for debugging, m
{{ end }}
```
-[`math.Counter`]: /functions/math/counter
+[`math.Counter`]: /functions/math/counter/
+
+[`warnidf`]: /functions/fmt/warnidf/