refactor: 完成静态网站转换,移除所有 CMS 和动态功能

- 删除数据库相关代码 (src/db/)
- 删除 API 路由 (src/app/api/)
- 删除认证相关代码 (src/lib/auth/, src/providers/)
- 删除监控和安全中间件 (src/lib/security/, src/lib/monitoring/)
- 删除 hooks (use-news, use-products, use-services)
- 更新组件为静态数据源
- 添加 nginx 静态配置和部署脚本
- 添加 static-link 组件
This commit is contained in:
张翔
2026-04-21 07:53:56 +08:00
parent cd1d6aa28a
commit 6403489954
197 changed files with 654 additions and 24762 deletions
+4 -18
View File
@@ -46,17 +46,7 @@ const NewsSection = dynamic(
}
);
interface SiteConfig {
feature_services?: { enabled: boolean; items: string[] };
feature_products?: { enabled: boolean; showPricing: boolean; featuredProducts: string[] };
feature_news?: { enabled: boolean; displayCount: number; categories: string[]; sortOrder: 'asc' | 'desc' };
}
interface HomeContentProps {
config: SiteConfig;
}
function HomeContent({ config }: HomeContentProps) {
function HomeContent() {
const searchParams = useSearchParams();
useEffect(() => {
@@ -74,18 +64,14 @@ function HomeContent({ config }: HomeContentProps) {
return undefined;
}, [searchParams]);
const showServices = config.feature_services?.enabled !== false;
const showProducts = config.feature_products?.enabled !== false;
const showNews = config.feature_news?.enabled !== false;
return (
<main className="min-h-screen bg-white dark:bg-(--color-bg-primary)">
<HeroSection />
{showServices && <ServicesSection config={config.feature_services} />}
{showProducts && <ProductsSection config={config.feature_products} />}
<ServicesSection />
<ProductsSection />
<CasesSection />
<AboutSection />
{showNews && <NewsSection config={config.feature_news} />}
<NewsSection />
</main>
);
}