Environment variables
How Project Broadsheet reads environment variables during the build, which variables matter for production, and how to set them on each major host.
Project Broadsheet reads a handful of environment variables during the build. They're optional, but in production a few of them are worth setting.
What variables the build reads
SITE_URL: the canonical URL of the site. Used for<link rel="canonical">, Open Graph image URLs, RSS feed self-links, and the XML sitemap. Falls back to the value inmeta.js.NODE_VERSION: tells your host which Node.js runtime to use for the build. Set to20(recommended) or18(LTS).
Where to set them
Cloudflare Pages
- Pages project → Settings → Environment variables.
- Add
NODE_VERSIONand any others, one per environment (Production, Preview). - Save. The next build picks them up.
Netlify
- Site settings → Environment variables → Add a variable.
- Set scope (all deploy contexts, or per-context).
- Save.
Vercel
- Project settings → Environment Variables.
- Add the key/value and select target environments (Production, Preview, Development).
- Redeploy to apply.
Local overrides
For local development, create a .env file at the repo root (it's in .gitignore):
SITE_URL=http://localhost:8080
Install dotenv or read it manually in eleventy.config.js. Most publishers don't need local overrides; defaults work fine.
What's NOT an environment variable
Integration keys (web3formsKey, buttondownUsername, umamiWebsiteId) live in src/_data/meta.js, committed to the repository. These are public values and don't need protection. If you want them out of git, you can move them to env vars and read them in meta.js:
web3formsKey: process.env.WEB3FORMS_KEY || "",
Then set WEB3FORMS_KEY in your host's environment variables. Only worth doing if you have a reason to keep these private.
What to do next
- Deploy to Cloudflare Pages for the default host walkthrough.
- Custom domain and HTTPS for DNS setup.
- Integrations to configure the services whose keys you'll add.
Browse Support for community channels and paid support options, or book a call if you'd like me to set it up for you.