> ## Documentation Index
> Fetch the complete documentation index at: https://supastack.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For the full documentation corpus in one file, fetch: https://supastack.dev/llms-full.txt

# 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 后端。

[安装工具并获取代码](https://supastack.dev/zh/docs/web/before-you-start.md)

[学习命令、文件和配置](https://supastack.dev/zh/docs/web/terminal-basics.md)

[完成Web首次运行教程](https://supastack.dev/zh/docs/web/ship-in-5-minutes.md)

```
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。


## 下一篇

[产品主题](https://supastack.dev/zh/docs/web/theming.md)
