From aed0f6342958d08c4f89074610c629a6bdfd7a2b Mon Sep 17 00:00:00 2001 From: siujamo Date: Wed, 25 Feb 2026 09:14:18 +0800 Subject: [PATCH] feat: add VITE_SEO_SITE_URL to environment configuration and update SEO component --- .env.example | 2 ++ src/components/seo/index.tsx | 2 +- src/vite-env.d.ts | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..1d9e349 --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +# SEO Site URL +VITE_SEO_SITE_URL=http://localhost:5173 diff --git a/src/components/seo/index.tsx b/src/components/seo/index.tsx index 5fd430c..fee722f 100644 --- a/src/components/seo/index.tsx +++ b/src/components/seo/index.tsx @@ -7,7 +7,7 @@ type SeoProps = { path: string } -const SITE_URL = "https://dev-lab.onixbyte.dev" +const SITE_URL = import.meta.env.VITE_SEO_SITE_URL const DEFAULT_IMAGE = `${SITE_URL}/onixbyte.svg` function setMetaTag(selector: string, attr: string, value: string) { diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index 391fbdf..527ccb7 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -1,8 +1,8 @@ /// interface ImportMetaEnv { - // todo add env properties here + readonly VITE_SEO_SITE_URL: string } interface ImportMeta { readonly env: ImportMetaEnv -} \ No newline at end of file +}