diff --git a/.env.example b/.env.example index cbf826b..90a3a37 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,3 @@ -MAIN_URL=ActualWebsiteUrlHere - # Clerk NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=PublishableKeyHere CLERK_SECRET_KEY=SecretKeyHere diff --git a/src/app/excalidraw/[slug]/page.tsx b/src/app/excalidraw/[slug]/page.tsx index 5ceff6a..8d98906 100644 --- a/src/app/excalidraw/[slug]/page.tsx +++ b/src/app/excalidraw/[slug]/page.tsx @@ -4,8 +4,7 @@ import { notFound } from 'next/navigation'; import ExcalidrawMain from '@/app/ui/components/excaliCore/ExcalidrawMain'; import { forkDrawingAction, saveDrawingAction, updateDrawingInfoAction } from '@/lib/actions'; import { Metadata } from 'next'; - -const MAIN_URL = process.env.MAIN_URL; +import { MAIN_URL } from '@/lib/constants'; export async function generateMetadata( { params }: { params: { slug: string } } @@ -36,12 +35,12 @@ export async function generateMetadata( title: title, description: description, alternates: { - canonical: `${process.env.MAIN_URL}/excalidraw/${params.slug}` + canonical: `${MAIN_URL}/excalidraw/${params.slug}` }, openGraph: { title: title, description: description, - url: `${process.env.MAIN_URL}/excalidraw/${params.slug}`, + url: `${MAIN_URL}/excalidraw/${params.slug}`, type: "article", images: [ { diff --git a/src/app/excalidraw/layout.tsx b/src/app/excalidraw/layout.tsx index 1f3aa95..03c9475 100644 --- a/src/app/excalidraw/layout.tsx +++ b/src/app/excalidraw/layout.tsx @@ -1,9 +1,10 @@ +import { MAIN_URL } from "@/lib/constants"; import { Metadata } from "next"; export const metadata: Metadata = { title: "Welcome to ExcaliHub", alternates: { - canonical: `${process.env.MAIN_URL}/excalidraw`, + canonical: `${MAIN_URL}/excalidraw`, } }; diff --git a/src/app/landing/layout.tsx b/src/app/landing/layout.tsx index b22ab42..b18bf79 100644 --- a/src/app/landing/layout.tsx +++ b/src/app/landing/layout.tsx @@ -1,9 +1,10 @@ +import { MAIN_URL } from "@/lib/constants"; import { Metadata } from "next"; export const metadata: Metadata = { title: "Landing", alternates: { - canonical: `${process.env.MAIN_URL}/landing`, + canonical: `${MAIN_URL}/landing`, } }; diff --git a/src/app/layout.tsx b/src/app/layout.tsx index a2a545e..c42e5df 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -10,12 +10,10 @@ import { theme } from "@/theme"; import { ClerkProvider } from "@clerk/nextjs"; import { Notifications } from "@mantine/notifications"; import { Metadata } from "next"; -import { APP_DESCRIPTION } from "@/lib/constants"; +import { APP_DESCRIPTION, MAIN_URL } from "@/lib/constants"; const CaviarDreams = localFont({ src: '../../public/CaviarDreams.ttf' }); -const MAIN_URL = process.env.MAIN_URL; - const description = APP_DESCRIPTION; const title = "Excalihub"; const author = "Nabil Mansour"; diff --git a/src/app/profile/[username]/page.tsx b/src/app/profile/[username]/page.tsx index bbbd31a..0ec9d1f 100644 --- a/src/app/profile/[username]/page.tsx +++ b/src/app/profile/[username]/page.tsx @@ -3,14 +3,13 @@ import SearchDrawings from '@/app/ui/components/excaliCore/components/SearchDraw import CenterContainer from '@/app/ui/components/other/CenterContainer'; import PaginationControls from '@/app/ui/components/other/PaginationControls'; import { getUserPublicDrawings, getUserPublicDrawingsCount, getUserIdByClerkId } from '@/db/queries'; +import { MAIN_URL } from '@/lib/constants'; import { clerkClient } from '@clerk/nextjs/server'; import { Box, Card, Flex, Group, Text } from '@mantine/core'; import { Metadata } from 'next'; import { notFound } from 'next/navigation'; import React from 'react'; -const MAIN_URL = process.env.MAIN_URL; - export async function generateMetadata( { params }: { params: { username: string } } ): Promise { @@ -30,12 +29,12 @@ export async function generateMetadata( title: title, description: description, alternates: { - canonical: `${process.env.MAIN_URL}/profile/${params.username}` + canonical: `${MAIN_URL}/profile/${params.username}` }, openGraph: { title: title, description: description, - url: `${process.env.MAIN_URL}/profile/${params.username}`, + url: `${MAIN_URL}/profile/${params.username}`, type: "article", images: [ { diff --git a/src/app/sign-in/[[...sign-in]]/layout.tsx b/src/app/sign-in/[[...sign-in]]/layout.tsx index f8c79ad..a3da608 100644 --- a/src/app/sign-in/[[...sign-in]]/layout.tsx +++ b/src/app/sign-in/[[...sign-in]]/layout.tsx @@ -1,10 +1,11 @@ +import { MAIN_URL } from "@/lib/constants"; import { Metadata } from "next"; export const metadata: Metadata = { title: "Sign In", description: "Sign in to your account on ExcaliHub.", alternates: { - canonical: `${process.env.MAIN_URL}/sign-in`, + canonical: `${MAIN_URL}/sign-in`, } }; diff --git a/src/app/sign-up/[[...sign-up]]/layout.tsx b/src/app/sign-up/[[...sign-up]]/layout.tsx index 1905c8c..23739f4 100644 --- a/src/app/sign-up/[[...sign-up]]/layout.tsx +++ b/src/app/sign-up/[[...sign-up]]/layout.tsx @@ -1,10 +1,11 @@ +import { MAIN_URL } from "@/lib/constants"; import { Metadata } from "next"; export const metadata: Metadata = { title: "Sign Up", description: "Sign up for an account on ExcaliHub.", alternates: { - canonical: `${process.env.MAIN_URL}/sign-up`, + canonical: `${MAIN_URL}/sign-up`, } }; diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts index 5cc2622..0fc05f0 100644 --- a/src/app/sitemap.ts +++ b/src/app/sitemap.ts @@ -1,8 +1,7 @@ import { fetchAllPublicDrawings } from '@/lib/data'; import { MetadataRoute } from 'next' import { unstable_noStore as noStore } from 'next/cache'; - -const MAIN_URL = process.env.MAIN_URL; +import { MAIN_URL } from '@/lib/constants'; export default async function sitemap(): Promise { noStore(); diff --git a/src/app/terms/layout.tsx b/src/app/terms/layout.tsx index a58c51f..b417446 100644 --- a/src/app/terms/layout.tsx +++ b/src/app/terms/layout.tsx @@ -1,10 +1,11 @@ +import { MAIN_URL } from "@/lib/constants"; import { Metadata } from "next"; export const metadata: Metadata = { title: "Terms", description: "Terms of Service and Privacy Policy for Excalihub web app.", alternates: { - canonical: `${process.env.MAIN_URL}/terms`, + canonical: `${MAIN_URL}/terms`, } };