diff --git a/.env.example b/.env.example index b4a7dbe..1d155b4 100644 --- a/.env.example +++ b/.env.example @@ -12,3 +12,4 @@ NEXT_PUBLIC_FixedTopServerName=false NEXT_PUBLIC_CustomLogo=https://nezha-cf.buycoffee.top/apple-touch-icon.png NEXT_PUBLIC_CustomTitle=NezhaDash NEXT_PUBLIC_CustomDescription=NezhaDash is a dashboard for Nezha. +NEXT_PUBLIC_DisableIndex=false diff --git a/app/layout.tsx b/app/layout.tsx index 61e8806..a93e882 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -19,6 +19,7 @@ const fontSans = FontSans({ const customTitle = getEnv("NEXT_PUBLIC_CustomTitle"); const customDescription = getEnv("NEXT_PUBLIC_CustomDescription"); +const disableIndex = getEnv("NEXT_PUBLIC_DisableIndex"); export const metadata: Metadata = { manifest: "/manifest.json", @@ -29,6 +30,10 @@ export const metadata: Metadata = { title: customTitle || "NezhaDash", statusBarStyle: "black-translucent", }, + robots: { + index: disableIndex ? false : true, + follow: disableIndex ? false : true, + }, }; export const viewport: Viewport = { diff --git a/docker/.env.example b/docker/.env.example index 21de401..a5e2bb9 100644 --- a/docker/.env.example +++ b/docker/.env.example @@ -11,4 +11,5 @@ NEXT_PUBLIC_ForceUseSvgFlag=false NEXT_PUBLIC_FixedTopServerName=false NEXT_PUBLIC_CustomLogo=https://nezha-cf.buycoffee.top/apple-touch-icon.png NEXT_PUBLIC_CustomTitle=NezhaDash -NEXT_PUBLIC_CustomDescription=NezhaDash is a dashboard for Nezha. \ No newline at end of file +NEXT_PUBLIC_CustomDescription=NezhaDash is a dashboard for Nezha. +NEXT_PUBLIC_DisableIndex=false \ No newline at end of file