hugo.Environment
Returns the current running environment.
Syntax
hugo.Environment
Returns
string
The hugo.Environment function returns the current running environment as defined through the --environment command line flag.
{{ hugo.Environment }} → productionCommand line examples:
| Command | Environment |
|---|---|
hugo build | production |
hugo build --environment staging | staging |
hugo server | development |
hugo server --environment staging | staging |
Last updated:
February 25, 2026
:
Merge commit '0c2fa2460f485e0eca564dcccf36d34538374922' (b0d3364f1)
Improve this page