基于 Next.js + TypeScript + Tailwind CSS 的现代化企业官网,针对 SEO 优化。
- ✅ SEO 优化 - 服务端渲染(SSR)和静态生成(SSG)
- ✅ 现代设计 - 极简风格,参考蝴蝶效应官网
- ✅ 响应式设计 - 完美适配移动设备
- ✅ 高性能 - 自动代码分割和图片优化
- ✅ 易于维护 - TypeScript + 清晰的项目结构
├── app/ # Next.js App Router
│ ├── layout.tsx # 全局布局和 SEO 设置
│ ├── page.tsx # 首页
│ ├── products/ # 产品页面
│ ├── contact/ # 联系页面
│ ├── globals.css # 全局样式
│ ├── sitemap.ts # Sitemap 配置
│ └── robots.ts # Robots 配置
├── components/ # React 组件
│ ├── Header.tsx # 导航栏
│ ├── Hero.tsx # 英雄板块
│ ├── Products.tsx # 产品列表
│ ├── Features.tsx # 功能特性
│ ├── CTA.tsx # 行动号召
│ ├── ProductDetail.tsx # 产品详情
│ ├── Contact.tsx # 联系表单
│ └── Footer.tsx # 页脚
├── public/ # 静态资源
├── package.json # 项目依赖
├── tsconfig.json # TypeScript 配置
├── tailwind.config.ts # Tailwind 配置
└── next.config.ts # Next.js 配置
npm installnpm run devnpm run build
npm startnpm run lint所有页面都配置了完整的元数据:
- 页面标题和描述
- Open Graph 标签
- 规范 URL
- 机器人元标签
app/sitemap.ts- 自动生成 sitemapapp/robots.ts- 配置搜索引擎爬虫规则public/robots.txt- 备用 robots.txt
- 服务端渲染(SSR)确保完整 HTML 被爬虫索引
- 自动代码分割和压缩
- 图片自动优化
- 字体预加载
- 编辑
app/layout.tsx中的openGraph.url - 编辑
app/layout.tsx中的alternates.canonical - 编辑
app/sitemap.ts中的baseUrl - 更新
public/robots.txt中的 Sitemap URL
在 .env.local 中添加:
NEXT_PUBLIC_GA_ID=你的Google Analytics ID然后在 app/layout.tsx 中集成 Google Analytics。
在 components/Contact.tsx 的 handleSubmit 函数中添加 API 调用来处理表单提交。
npm install -g vercel
vercel该项目支持部署到任何支持 Node.js 的平台:
- Docker
- AWS
- Google Cloud
- 阿里云
- 腾讯云等
- 框架: Next.js 15
- 语言: TypeScript
- 样式: Tailwind CSS
- 字体: Google Fonts (Geist)
- 代码检查: ESLint
MIT License