mirror of
https://github.com/Xevion/xevion.dev.git
synced 2025-12-06 01:16:58 -06:00
Vercel does not support multiple environments for free, so we use a hack instead :)
This commit is contained in:
4
src/env/schema.mjs
vendored
4
src/env/schema.mjs
vendored
@@ -7,10 +7,6 @@ import { z } from "zod";
|
|||||||
*/
|
*/
|
||||||
export const serverSchema = z.object({
|
export const serverSchema = z.object({
|
||||||
DIRECTUS_REVALIDATE_KEY: z.string(),
|
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"]),
|
NODE_ENV: z.enum(["development", "test", "production"]),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
import AppWrapper from "@/components/AppWrapper";
|
import AppWrapper from "@/components/AppWrapper";
|
||||||
import { env } from "@/env/server.mjs";
|
|
||||||
import directus from "@/utils/directus";
|
import directus from "@/utils/directus";
|
||||||
import { readSingleton } from "@directus/sdk";
|
import { readSingleton } from "@directus/sdk";
|
||||||
import { GetStaticPropsResult, type NextPage } from "next";
|
import { GetStaticPropsResult, type NextPage } from "next";
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
import Balancer from "react-wrap-balancer";
|
import Balancer from "react-wrap-balancer";
|
||||||
|
|
||||||
type IndexProps = {
|
type IndexProps = {
|
||||||
title: string | null;
|
|
||||||
tagline: string;
|
tagline: string;
|
||||||
buttons: { text: string; href: string }[];
|
buttons: { text: string; href: string }[];
|
||||||
};
|
};
|
||||||
@@ -25,7 +24,6 @@ export async function getStaticProps(): Promise<
|
|||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
tagline: metadata.tagline,
|
tagline: metadata.tagline,
|
||||||
title: env.OVERRIDE_TITLE,
|
|
||||||
buttons: [
|
buttons: [
|
||||||
{ text: "GitHub", href: "https://github.com/Xevion" },
|
{ text: "GitHub", href: "https://github.com/Xevion" },
|
||||||
{ text: "Projects", href: "/projects" },
|
{ text: "Projects", href: "/projects" },
|
||||||
@@ -38,11 +36,15 @@ export async function getStaticProps(): Promise<
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const Home: NextPage<IndexProps> = ({
|
const Home: NextPage<IndexProps> = ({ tagline, buttons }: IndexProps) => {
|
||||||
title,
|
const [isWalters, setIsWalters] = useState(false);
|
||||||
tagline,
|
useEffect(() => {
|
||||||
buttons,
|
// Check if URL contains "walters.to"
|
||||||
}: IndexProps) => {
|
if (location.href.includes("walters.to")) {
|
||||||
|
setIsWalters(true);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Head>
|
<Head>
|
||||||
@@ -68,7 +70,9 @@ const Home: NextPage<IndexProps> = ({
|
|||||||
</nav>
|
</nav>
|
||||||
<div className="animate-glow hidden h-px w-screen animate-fade-left bg-gradient-to-r from-zinc-300/0 via-zinc-300/50 to-zinc-300/0 md:block" />
|
<div className="animate-glow hidden h-px w-screen animate-fade-left bg-gradient-to-r from-zinc-300/0 via-zinc-300/50 to-zinc-300/0 md:block" />
|
||||||
<h1 className="text-edge-outline font-display z-10 my-3.5 animate-title whitespace-nowrap bg-white bg-clip-text font-hanken text-5xl uppercase text-transparent drop-shadow-extreme duration-1000 sm:text-6xl md:text-9xl lg:text-10xl">
|
<h1 className="text-edge-outline font-display z-10 my-3.5 animate-title whitespace-nowrap bg-white bg-clip-text font-hanken text-5xl uppercase text-transparent drop-shadow-extreme duration-1000 sm:text-6xl md:text-9xl lg:text-10xl">
|
||||||
<span className="select-none">{title ?? "Xevion"}</span>
|
<span className="select-none">
|
||||||
|
{isWalters ? "Walters" : "Xevion"}
|
||||||
|
</span>
|
||||||
</h1>
|
</h1>
|
||||||
<div className="animate-glow hidden h-px w-screen animate-fade-right bg-gradient-to-r from-zinc-300/0 via-zinc-300/50 to-zinc-300/0 md:block" />
|
<div className="animate-glow hidden h-px w-screen animate-fade-right bg-gradient-to-r from-zinc-300/0 via-zinc-300/50 to-zinc-300/0 md:block" />
|
||||||
<div className="max-w-screen-sm animate-fade-in text-center text-sm text-zinc-500 sm:text-base">
|
<div className="max-w-screen-sm animate-fade-in text-center text-sm text-zinc-500 sm:text-base">
|
||||||
|
|||||||
Reference in New Issue
Block a user