swyxio / swyxkit

An opinionated blog starter for SvelteKit + Tailwind + Netlify. Refreshed for SvelteKit 1.0!
https://swyxkit.netlify.app/
MIT License
682 stars 89 forks source link

use env/static/public for siteConfigs #99

Closed ak4zh closed 2 years ago

ak4zh commented 2 years ago

Use env store for siteConfig values

closes #95

swyxio commented 2 years ago

hmm build error image

ak4zh commented 2 years ago

@sw-yx You need to add all the .env values in the Environment Variables in Netlify or Vercel dashboard

ak4zh commented 2 years ago
swyxio commented 2 years ago

sorry for the delay, let me try this now

swyxio commented 2 years ago

ok @ak4zh ... after a lot of thinking, i have a potentially controversial opinion here:

i think this adds more complexity than is beneficial for our usecase. Env stores should mainly be for 1) secrets that should not be stored in the codebase 2) reflecting env vars injected by the CI/CD system into the frontend.

right now, i only need to know one rule, which is how to import variables. if a contributor want to update, for example, my site title, or youtube, they just search this repo and they can find everything they need

with the env store, this information is now split across my codebase and my deployment choice. i dont really want to debug differences between env var handling for different hosts, and contributors cant really change it (if they dont have the login to the deployment platform), and there are more lines of code to edit when adding/removing/updating a sitewide variable.

the thing that started putting me off was seeing stuff like this image

seeing the og:image URL inside the URL, this made me want to reduce the number of env vars, which made me step back and say "this is a code smell".

what do you think?

cc @kevmodrome since you had the original idea