hugo/docs/content/en/functions/hugo/Environment.md
2025-01-23 09:47:46 +01:00

655 B

title description categories keywords action
hugo.Environment Returns the current running environment.
aliases related returnType signatures
functions/hugo/IsDevelopment
functions/hugo/IsProduction
string
hugo.Environment

The hugo.Environment function returns the current running environment as defined through the --environment command line flag.

{{ hugo.Environment }} → production

Command line examples:

Command Environment
hugo production
hugo --environment staging staging
hugo server development
hugo server --environment staging staging