SaaS 落地页生成器技能 是做什么的?
触发词
- "帮我做一个 SaaS 落地页"
- "generate a saas landing page"
- "创建一个软件产品官网"
- "landing page for my saas"
该技能的功能
生成一个完整的、生产就绪的 SaaS 落地页,并一键部署到 EdgeOne Pages。
输出结果:一个可访问的托管 URL + 完整源代码。
技术栈
- 框架:React 18 + Vite
- 样式:Tailwind CSS
- 部署:EdgeOne Pages(自动)
- 可选:用于表单处理的 Edge Functions
工作流程
步骤 1:收集需求
向用户询问(或从上下文中推断):
- 产品名称/品牌
- 标语/一句话简介
- 核心功能(3-5 个)
- 定价层级(可选)
- 配色偏好
如果信息缺失,则使用合理的默认值并继续执行。
步骤 2:生成代码
创建一个包含以下结构的 Vite + React + Tailwind 项目:
saas-landing/
├── index.html
├── package.json
├── vite.config.js
├── tailwind.config.js
├── postcss.config.js
├── src/
│ ├── main.jsx
│ ├── App.jsx
│ ├── index.css
│ └── components/
│ ├── Navbar.jsx
│ ├── Hero.jsx
│ ├── Features.jsx
│ ├── Pricing.jsx
│ ├── Testimonials.jsx
│ ├── CTA.jsx
│ └── Footer.jsx
└── public/
└── favicon.svg
步骤 3:部署到 EdgeOne Pages
生成代码后,运行:
# 安装 EdgeOne Pages CLI
npm install -g edgeone-pages-cli
# 部署
edgeone-pages deploy . --name <project-name>
或者引导用户将 Git 仓库连接到 EdgeOne Pages,实现自动部署。
代码模板
package.json
{
"name": "saas-landing",
"private": true,
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"@vitejs/plugin-react": "^4.2.0",
"autoprefixer": "^10.4.17",
"postcss": "^8.4.33",
"tailwindcss": "^3.4.1",
"vite": "^5.0.0"
}
}
tailwind.config.js
/** @type {import('tailwindcss').Config} */
export default {
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
theme: {
extend: {
colors: {
brand: {
50: '#eff6ff',
100: '#dbeafe',
200: '#bfdbfe',
300: '#93c5fd',
400: '#60a5fa',
500: '#3b82f6',
600: '#2563eb',
700: '#1d4ed8',
800: '#1e40af',
900: '#1e3a8a',
},
},
},
},
plugins: [],
}
src/App.jsx(完整示例)
import React from 'react'
import Navbar from './components/Navbar'
import Hero from './components/Hero'
import Features from './components/Features'
import Pricing from './components/Pricing'
import Testimonials from './components/Testimonials'
import CTA from './components/CTA'
import Footer from './components/Footer'
export default function App() {
return (
<div className="min-h-screen bg-white">
<Navbar />
<main>
<Hero />
<Features />
<Pricing />
<Testimonials />
<CTA />
</main>
<Footer />
</div>
)
}
src/components/Hero.jsx(关键部分)
import React from 'react'
export default function Hero({ productName = "Your SaaS", tagline = "The best solution for your business" }) {
return (
<section className="relative bg-gradient-to-br from-brand-600 to-brand-800 text-white py-24 px-6 text-center">
<div className="max-w-4xl mx-auto">
<h1 className="text-5xl font-bold mb-6">{productName}</h1>
<p className="text-xl mb-8 text-brand-100">{tagline}</p>
<div className="flex gap-4 justify-center">
<button className="bg-white text-brand-700 px-8 py-3 rounded-lg font-semibold hover:bg-brand-50 transition">
免费开始
</button>
<button className="border border-white px-8 py-3 rounded-lg font-semibold hover:bg-white/10 transition">
查看演示
</button>
</div>
</div>
</section>
)
}
EdgeOne Pages 部署
代码生成后,确保通过以下方式部署:
- 选项 A:CLI 部署
npx edgeone-pages-cli deploy . --name saas-landing-demo
- 选项 B:基于 Git 的部署
- 将代码推送到 GitHub
- 在 EdgeOne Pages 控制台连接仓库
- 推送时自动部署
- 验证部署 URL 并返回给用户。
最佳实践
- 使用语义化 HTML 以利于 SEO
- 确保移动端响应式(使用 Tailwind 类)
- 在
index.html中添加 meta 标签 - 优化图片(尽量使用 SVG)
- 包含用于社交分享的 OG 标签
对用户的示例提示
为 [产品名称] 创建一个 SaaS 落地页。
标语:[一句话描述]
功能:[功能1]、[功能2]、[功能3]
定价:免费 / 专业版($29/月)/ 企业版(联系销售)
配色:[蓝色/紫色/绿色/自定义]
部署到 EdgeOne Pages。