11ty / 11ty-website

Documentation site for the Eleventy static site generator.
https://www.11ty.dev/
MIT License
473 stars 681 forks source link

Add note on where the env variables are available #1583

Closed anantakrishna closed 7 months ago

anantakrishna commented 1 year ago

As of now, the wording is quite broad and may create confusion.

https://www.11ty.dev/docs/environment-vars/

You can set and use your own environment variables in your projects. They will be available in your code…

One may think that the environment variables are available in all the code, from templates to JS assets. It may take time to understand the truth.

This PR adds a note in the beginning that explains the borders of applicability.

I'm not sure about the JS templates, whether env vars are exposed there or not. The whole note text needs scrupulous check by a maintainer since it's just my understanding of how it works.

zachleat commented 7 months ago

Shipping, Thank you!