feat(env): add disable index env

This commit is contained in:
hamster1963 2024-11-11 15:10:40 +08:00
parent 9202985fdc
commit b5d0bc0b65
3 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -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 = {

View File

@ -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.
NEXT_PUBLIC_CustomDescription=NezhaDash is a dashboard for Nezha.
NEXT_PUBLIC_DisableIndex=false