hugo/docs/content/en/functions/fmt/Errorf.md
2023-10-20 09:43:56 +02:00

984 B

title linkTitle description categories keywords menu function relatedFunctions aliases
fmt.Errorf errorf Log an ERROR from a template.
functions
docs
parent
functions
aliases returnType signatures
errorf
string
fmt.Errorf FORMAT [INPUT]
fmt.Errorf
fmt.Erroridf
fmt.Warnf
/functions/errorf

The documentation for Go's fmt package describes the structure and content of the format string.

Like the printf function, the errorf function evaluates the format string. It then prints the result to the ERROR log and fails the build. Hugo prints each unique message once to avoid flooding the log with duplicate errors.

{{ errorf "The %q shortcode requires a src parameter. See %s" .Name .Position }}

Use the erroridf function to allow optional suppression of specific errors.