用途:该技能用于排查 Next.js 站点的 Google Search Console 覆盖率问题,例如重复 canonical、误加 noindex、抓取浪费、已发现但未索引的 URL,也可在 SEO 发布前审计 sitemap、robots.txt、重定向、内链与静态渲染问题。
主要能力:对照 Search Console 状态给出修复方向,覆盖 crawled–not indexed(改善内容质量、canonical、内链)、duplicate without canonical(补充显式 canonical)、excluded by noindex(若需索引则移除 noindex)、发现但未索引(改善内链与抓取预算)、重定向页(缩短重定向链)等。提供 Next.js App Router 的 metadata、generateMetadata、robots.js、sitemap 路由示例。
使用方式:依次做 canonical 审计、noindex 审计、sitemap 健康检查、静态渲染验证、内链审计、重定向审计与 robots.txt 检查。例如用 rg -n --glob '*.{js,ts,jsx,tsx}' 'noindex|robots.*noindex' app pages 查找误加 noindex;用 curl -sI https://www.yourdomain.com/sitemap.xml | grep -i "content-type\|status" 验证 sitemap 返回 200 且为有效 XML;构建后检查页面应显示 ●(静态)而非 λ(动态);对已知 slug 的动态路由添加 generateStaticParams。canonical 需使用绝对 URL,如 canonical: 'https://www.yourdomain.com/blog/my-post';next.config.js 中重定向保持扁平并设 permanent: true。
适用场景:Next.js 站点的 SEO 发布前审计,以及 Search Console 出现覆盖率错误、抓取预算被浪费或重要页面未被索引时的诊断。
限制:不能保证 Google 一定收录页面,最终决定权在搜索引擎;需要代码库、已部署 URL,最好有 Search Console 数据;涉及 URL 结构、重定向或 canonical 策略的改动可能影响线上环境,发布前应审查。其他细节暂未提供。