Eleventy with environment variables
Environment variables are handy in Eleventy but did you know that you can use them inside your markdown files?
By using a JavaScript data file, we can expose process.env
variables that might be in an .env
file, your hosting provider’s dashboard, or even in your Docker setup.
This is one of two versions of this site. Head over to the other site to see the differences.
Here’s an example: The environment variable, HELLO
is currently: “Hello not set, but hi, anyway 👋”. This is called with {{ env.hello }}
.