diff --git a/web/src/lib/env.ts b/web/src/lib/env.ts new file mode 100644 index 00000000..a5f08382 --- /dev/null +++ b/web/src/lib/env.ts @@ -0,0 +1,9 @@ +import { env } from "$env/dynamic/public"; + +const variables = { + HOST: env.PUBLIC_HOST, + PLAUSIBLE_HOST: env.PUBLIC_PLAUSIBLE_HOST, + PLAUSIBLE_ENABLED: env.PUBLIC_HOST && env.PUBLIC_PLAUSIBLE_HOST, +} + +export default variables; diff --git a/web/src/routes/+layout.svelte b/web/src/routes/+layout.svelte index e203f1de..20eeabbc 100644 --- a/web/src/routes/+layout.svelte +++ b/web/src/routes/+layout.svelte @@ -2,6 +2,7 @@ import "@fontsource/ibm-plex-mono/400.css"; import "@fontsource/ibm-plex-mono/500.css"; + import env from "$lib/env"; import settings from "$lib/state/settings"; import { device, app } from "$lib/device"; import { locale } from "$lib/i18n/translations"; @@ -23,6 +24,15 @@ {#if device.is.mobile} {/if} + + {#if env.PLAUSIBLE_ENABLED} + + {/if}