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:
September 25, 2026
:
content: Hyphenate command-line when used as an adjective (2d644c5fa)
Improve this page