Hugo Env Shortcode

Get environment variables.

Donate

Become a backer or sponsor to support our work.

Sponsors

Use Cases

This shortcode is mainly used to read certain information from environment variables. Imagine you have a public site repository with your personal contact email address in it, and when someone else forks and deploys a new site and forgets to change the email address, it will undoubtedly bring you unnecessary contact and trouble.

When using GitHub Actions for deployment, you’ll need to store the info in GitHub secrets, and pass it to environment variables.

Shortcode Syntax

1{{< env >}}

Shortcode Parameters

name

PositionNameTypeDefaultRequired
#0namestring-Y

Examples

1{{< env "CI" >}}