Skip to content

Latest commit

 

History

History
47 lines (37 loc) · 1010 Bytes

index.md

File metadata and controls

47 lines (37 loc) · 1010 Bytes
title linkTitle description nav_weight featured pinned date draft series categories tags authors images
Hugo Env Shortcode
Env
Get environment variables.
1000
false
false
2023-09-08 17:47:03 +0800
false
Docs
Shortcodes
Environment Variables
HugoMods

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

{{</* env */>}}

Shortcode Parameters

{{% shortcode-params "data/params.yaml" %}}

Examples

{{</* env "CI" */>}}

{{< env "CI" >}}