From 6d71fde9eefe172e027af63123e8e60e20a05469 Mon Sep 17 00:00:00 2001 From: shinya Date: Mon, 30 Jun 2025 21:31:15 +0800 Subject: [PATCH] feat: add custom site name --- README.md | 1 + src/app/layout.tsx | 2 +- src/app/login/page.tsx | 2 +- src/components/MobileHeader.tsx | 2 +- src/components/Sidebar.tsx | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e211892..61c067b 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ Pull Bot 会反复触发无效的 PR 和垃圾邮件,严重干扰项目维护 | NEXT_PUBLIC_ENABLE_BLOCKAD | 开启智能去广告功能(实验性) | true / false | false | | NEXT_PUBLIC_SEARCH_MAX_PAGE | 搜索接口可拉取的最大页数 | 1-50 | 5 | | NEXT_PUBLIC_AGGREGATE_SEARCH_RESULT | 搜索结果默认是否按标题和年份聚合 | true / false | true | +| NEXT_PUBLIC_SITE_NAME | 站点名称 | 任意 string | MoonTV | ## 配置说明 diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 04f7d3b..930d82b 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -8,7 +8,7 @@ import { ThemeProvider } from '../components/ThemeProvider'; const inter = Inter({ subsets: ['latin'] }); export const metadata: Metadata = { - title: 'MoonTV', + title: process.env.NEXT_PUBLIC_SITE_NAME || 'MoonTV', description: '影视聚合', manifest: '/manifest.json', }; diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index 5221c57..e57420f 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -47,7 +47,7 @@ function LoginPageClient() {

- MoonTV + {process.env.NEXT_PUBLIC_SITE_NAME || 'MoonTV'}

diff --git a/src/components/MobileHeader.tsx b/src/components/MobileHeader.tsx index c5a3f99..6964a77 100644 --- a/src/components/MobileHeader.tsx +++ b/src/components/MobileHeader.tsx @@ -12,7 +12,7 @@ const MobileHeader = () => { href='/' className='text-2xl font-bold text-green-600 tracking-tight hover:opacity-80 transition-opacity' > - MoonTV + {process.env.NEXT_PUBLIC_SITE_NAME || 'MoonTV'}
diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 1a81652..ac21495 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -39,7 +39,7 @@ const Logo = () => ( className='flex items-center justify-center h-16 select-none hover:opacity-80 transition-opacity duration-200' > - MoonTV + {process.env.NEXT_PUBLIC_SITE_NAME || 'MoonTV'} );