From 1444c835ca4ff8ae63f86177333aff8737942ad6 Mon Sep 17 00:00:00 2001 From: Realmy <163438634+RealmyTheMan@users.noreply.github.com> Date: Sun, 9 Feb 2025 20:45:37 +0100 Subject: [PATCH] feat: add VERT name const for different environments --- .env.example | 4 ++-- src/lib/consts.ts | 8 ++++++++ src/routes/+layout.svelte | 10 +++++----- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.env.example b/.env.example index 8027000..500a46c 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,3 @@ -PUB_HOSTNAME=vert.sh # only gets used for plausible (for now) +PUB_HOSTNAME=localhost:5173 # only gets used for plausible (for now) PUB_PLAUSIBLE_URL=https://plausible.example.com # can be empty -PUB_ENV=production # "production" or "nightly" \ No newline at end of file +PUB_ENV=development # "production", "development", or "nightly" \ No newline at end of file diff --git a/src/lib/consts.ts b/src/lib/consts.ts index 2b1f62f..8cdd909 100644 --- a/src/lib/consts.ts +++ b/src/lib/consts.ts @@ -1,4 +1,12 @@ +import { PUB_ENV } from "$env/static/public"; + export const GITHUB_URL_VERT = "https://github.com/VERT-sh/VERT"; export const GITHUB_URL_VERTD = "https://github.com/VERT-sh/vertd"; export const GITHUB_API_URL = "https://api.github.com/repos/VERT-sh/VERT"; export const DISCORD_URL = "https://discord.gg/kqevGxYPak"; +export const VERT_NAME = + PUB_ENV === "development" + ? "VERT Local" + : PUB_ENV === "nightly" + ? "VERT Nightly" + : "VERT.sh"; diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index f471095..e51e764 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -27,7 +27,7 @@ import { onMount } from "svelte"; import { quintOut } from "svelte/easing"; import "../app.scss"; - import { DISCORD_URL, GITHUB_URL_VERT } from "$lib/consts"; + import { DISCORD_URL, GITHUB_URL_VERT, VERT_NAME } from "$lib/consts"; import { type Toast as ToastType, toasts } from "$lib/store/ToastProvider"; import Toast from "$lib/components/visual/Toast.svelte"; import { Settings } from "$lib/sections/settings/index.svelte"; @@ -120,11 +120,11 @@ - VERT.sh + {VERT_NAME}