From a280b61c5e71b0d53813040b5f33679710e8d5e4 Mon Sep 17 00:00:00 2001 From: Xevion Date: Sun, 29 Dec 2024 16:49:41 -0600 Subject: [PATCH] Vercel does not support multiple environments for free, so we use a hack instead :) --- src/env/schema.mjs | 4 ---- src/pages/index.tsx | 22 +++++++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/env/schema.mjs b/src/env/schema.mjs index 494ab7f..05c6629 100644 --- a/src/env/schema.mjs +++ b/src/env/schema.mjs @@ -7,10 +7,6 @@ import { z } from "zod"; */ export const serverSchema = z.object({ DIRECTUS_REVALIDATE_KEY: z.string(), - OVERRIDE_TITLE: z.preprocess((v) => { - if (v === undefined || v === "") return null; - return v; - }, z.string().nullable()), NODE_ENV: z.enum(["development", "test", "production"]), }); diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 2f6dcbf..3a7d1eb 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,14 +1,13 @@ import AppWrapper from "@/components/AppWrapper"; -import { env } from "@/env/server.mjs"; import directus from "@/utils/directus"; import { readSingleton } from "@directus/sdk"; import { GetStaticPropsResult, type NextPage } from "next"; import Head from "next/head"; import Link from "next/link"; +import { useEffect, useState } from "react"; import Balancer from "react-wrap-balancer"; type IndexProps = { - title: string | null; tagline: string; buttons: { text: string; href: string }[]; }; @@ -25,7 +24,6 @@ export async function getStaticProps(): Promise< return { props: { tagline: metadata.tagline, - title: env.OVERRIDE_TITLE, buttons: [ { text: "GitHub", href: "https://github.com/Xevion" }, { text: "Projects", href: "/projects" }, @@ -38,11 +36,15 @@ export async function getStaticProps(): Promise< }; } -const Home: NextPage = ({ - title, - tagline, - buttons, -}: IndexProps) => { +const Home: NextPage = ({ tagline, buttons }: IndexProps) => { + const [isWalters, setIsWalters] = useState(false); + useEffect(() => { + // Check if URL contains "walters.to" + if (location.href.includes("walters.to")) { + setIsWalters(true); + } + }, []); + return ( <> @@ -68,7 +70,9 @@ const Home: NextPage = ({

- {title ?? "Xevion"} + + {isWalters ? "Walters" : "Xevion"} +