用途:为 Web 应用提供页面级 SEO 实现规范,涵盖 meta 标签、结构化数据、站点地图与搜索优化模式。触发场景包括添加 meta 标签、sitemap、提升搜索排名或审计 SEO。
主要能力:
- 核心 meta:每页需有唯一 title(50–60 字符,品牌置尾)与 description(120–160 字符,行动导向)。
- Open Graph 与 Twitter Card:至少包含 og:title、og:description、og:image、og:url、og:type;OG 图建议 1200×630px、小于 8MB、JPG 或 PNG,放在 /og/ 目录。
- Canonical:每页使用绝对 URL 的自引用 canonical;分页页 canonical 指向自身而非第一页;筛选/排序参数 URL 归一到基础 URL;尾斜杠需与 robots.txt、sitemap 保持一致。
- 结构化数据 JSON-LD:Article、Product+Offer、FAQPage、LocalBusiness、BreadcrumbList 等,可用 Google Rich Results Test 与 Schema.org Validator 校验。
- robots.txt 与 sitemap.xml:robots.txt 置于域名根目录并声明 Sitemap;sitemap 含 loc、lastmod、changefreq、priority,部署后提交至 Google Search Console 与 Bing Webmaster Tools。
- 多语言:使用 hreflang 指向所有语言版本,含自引用与 x-default 回退。
使用方式:按决策树选择对应模式;SPA 或动态路由需在每次路由变化时更新 title 与 canonical,并确保 meta 出现在 SSR/SSG 的 HTML 中,而非 hydration 后注入。
适用场景:新页面 meta 配置、社交分享卡片、结构化数据、sitemap 生成、多语言站点、canonical 问题排查。
限制:不适用于 Web 性能优化(用 web-performance)、无障碍合规(用 a11y)、Next.js Metadata API 细节(用 next)、Astro SEO 集成(用 astro)。Google 已弃用 rel="next"/"prev",canonical 即可。薄内容或重复页可用 noindex, nofollow。