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">
Get Started Free
</button>
<button className="border border-white px-8 py-3 rounded-lg font-semibold hover:bg-white/10 transition">
See Demo
</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。