Template
Simplify site metadata and centralize site configuration
This commit is contained in:
+3
-40
@@ -2,6 +2,7 @@ import type { Metadata } from "next";
|
|||||||
import { Geist, Geist_Mono } from "next/font/google";
|
import { Geist, Geist_Mono } from "next/font/google";
|
||||||
|
|
||||||
import { ThemeProvider } from "@/components/layout/theme-provider";
|
import { ThemeProvider } from "@/components/layout/theme-provider";
|
||||||
|
import { siteConfig } from "@/lib/site";
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
|
|
||||||
const geistSans = Geist({
|
const geistSans = Geist({
|
||||||
@@ -14,47 +15,9 @@ const geistMono = Geist_Mono({
|
|||||||
subsets: ["latin"],
|
subsets: ["latin"],
|
||||||
});
|
});
|
||||||
|
|
||||||
const siteName = "Vertex — The Unified AI Gateway";
|
|
||||||
const siteDescription =
|
|
||||||
"Route, optimize, and observe every AI model request through one OpenAI-compatible API.";
|
|
||||||
|
|
||||||
// Absolute origin behind `metadataBase`, so Open Graph images resolve to full
|
|
||||||
// URLs. Vercel injects VERCEL_PROJECT_PRODUCTION_URL on deployed builds.
|
|
||||||
const siteUrl =
|
|
||||||
process.env.NEXT_PUBLIC_SITE_URL ??
|
|
||||||
(process.env.VERCEL_PROJECT_PRODUCTION_URL
|
|
||||||
? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`
|
|
||||||
: "http://localhost:3000");
|
|
||||||
|
|
||||||
// Routes only set their own `title`; the template appends the site name.
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
metadataBase: new URL(siteUrl),
|
title: siteConfig.name,
|
||||||
title: {
|
description: siteConfig.description,
|
||||||
default: siteName,
|
|
||||||
template: `%s — ${siteName}`,
|
|
||||||
},
|
|
||||||
description: siteDescription,
|
|
||||||
openGraph: {
|
|
||||||
type: "website",
|
|
||||||
siteName,
|
|
||||||
title: siteName,
|
|
||||||
description: siteDescription,
|
|
||||||
url: "/",
|
|
||||||
images: [
|
|
||||||
{
|
|
||||||
url: "/og.png",
|
|
||||||
width: 1732,
|
|
||||||
height: 908,
|
|
||||||
alt: "Vertex — One API for every AI model",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
twitter: {
|
|
||||||
card: "summary_large_image",
|
|
||||||
title: siteName,
|
|
||||||
description: siteDescription,
|
|
||||||
images: ["/og.png"],
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function RootLayout({
|
export default function RootLayout({
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
export const siteConfig = {
|
||||||
|
name: "Vertex — The Unified AI Gateway",
|
||||||
|
url: "http://localhost:3000",
|
||||||
|
description:
|
||||||
|
"Route, optimize, and observe every AI model request through one OpenAI-compatible API.",
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user