From 250d0baff88280132d89c64080e56ef08054a13f Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Sun, 20 Oct 2024 00:09:19 +0800 Subject: [PATCH] fix: custome metadata --- app/[locale]/layout.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/[locale]/layout.tsx b/app/[locale]/layout.tsx index 94542ae..4671348 100644 --- a/app/[locale]/layout.tsx +++ b/app/[locale]/layout.tsx @@ -1,5 +1,6 @@ // @auto-i18n-check. Please do not delete the line. import { locales } from "@/i18n-metadata"; +import getEnv from "@/lib/env-entry"; import { cn } from "@/lib/utils"; import "@/styles/globals.css"; import type { Metadata } from "next"; @@ -18,13 +19,16 @@ const fontSans = FontSans({ variable: "--font-sans", }); +const customTitle = getEnv("NEXT_PUBLIC_CustomTitle"); +const customDescription = getEnv("NEXT_PUBLIC_CustomDescription"); + export const metadata: Metadata = { manifest: "/manifest.json", - title: "NezhaDash", - description: "A dashboard for nezha", + title: customTitle || "NezhaDash", + description: customDescription || "A dashboard for nezha", appleWebApp: { capable: true, - title: "NezhaDash", + title: customTitle || "NezhaDash", statusBarStyle: "black-translucent", }, };