For AI agents: fetch the complete documentation index at /llms.txt, the full documentation corpus at /llms-full.txt, the agent skill at /skill.md, or this page as Markdown at /zh-tw/docs/web/seo.md (or send Accept: text/markdown).
SEO 與分享
後設資料、sitemap、robots 與社交圖。
開始之前
使用“檔案”→“開啟資料夾”在 Visual Studio Code 中開啟下載的 supastack 專案,然後選擇“終端”→“新建終端”。儲存庫根目錄是包含 package.json、apps 和 packages 的資料夾。執行下面的命令並保持終端開啟。如果無法識別命令,請先完成工具安裝指南,然後再繼續。
首先閱讀平臺教程。伺服器是響應瀏覽器或電話請求的應用程式程式。 Web 讀取 apps/web/.env.local,Expo 讀取 apps/mobile/.env.local,資料庫遷移命令讀取 root .env。無資料庫/儀錶板演示與真實/身份驗證帳戶分開,需要遷移Postgres。僅電話或桌面結帳需要單獨執行的 Web 後端。
corepack pnpm --filter @supastack/web dev安裝與配置
路由級後設資料來自 Next.js metadata API —— 頁面匯出 metadata 物件或 generateMetadata,並從語言詞典解析標題與描述,讓搜尋結果保持本地化。
sitemap.ts 與 robots.ts 生成可抓取介面;Open Graph 圖與圖示資源承載社交預覽。把私有路由 —— settings、billing、admin、API —— 排除在 sitemap 之外並在 robots 中 disallow。
app/sitemap.ts public routes only
app/robots.ts disallow private surfaces
// per page
export const metadata = { title, description };實現流程
給每個公開頁面唯一的標題與描述;絕不索引搜尋結果、過濾檢視或已認證介面。Canonical URL 保持無字首 —— 語言層已把預設語言重定向到規範路徑。
新增公開路由時在同一次改動里加入 sitemap。OG 圖堅持用品牌令牌而非烘焙截圖,讓換風格保持一致。
驗證與排障
在預覽部署上拉取 /robots.txt 與 /sitemap.xml,校驗 sitemap 可解析,並抽查一個頁面的分享效果 —— 標題、描述、圖。確認搜尋結果頁帶 noindex。