通过 IndexNow 协议向 Bing、Yandex、Naver、Seznam 等搜索引擎提交 URL,加速页面收录。提交到 api.indexnow.org 会自动分发给所有支持的搜索引擎。
curl(macOS/Linux 内置)public/ 目录检查项目根目录是否存在 .indexnow-key 文件:
```bash
${CLAUDE_SKILL_ROOT}/scripts/indexnow.sh generate-key
```
脚本会生成随机 key,保存到 .indexnow-key,并在 public/ 目录创建 {key}.txt 验证文件。
检查 public/{key}.txt 是否存在且内容正确。提醒用户:验证文件需要随项目部署后,搜索引擎才能验证 key。
根据用户需求选择提交方式:
提交单个或多个 URL:
${CLAUDE_SKILL_ROOT}/scripts/indexnow.sh submit https://example.com/page1 https://example.com/page2
从本地 sitemap.xml 提取并提交:
${CLAUDE_SKILL_ROOT}/scripts/indexnow.sh submit-sitemap [path]
默认读取 public/sitemap.xml。
从远程 sitemap URL 提取并提交:
${CLAUDE_SKILL_ROOT}/scripts/indexnow.sh submit-sitemap-url https://example.com/sitemap.xml
脚本会输出每个 URL 的提交结果。响应码含义:
| 响应码 | 含义 | 处理方式 |
|---|---|---|
| -------- | ------ | ---------- |
| 200 | 提交成功 | 无需操作 |
| 202 | 已接收,待验证 | 确认验证文件已部署 |
| 400 | 格式错误 | 检查 URL 格式 |
| 403 | key 无效 | 重新生成 key 并部署 |
| 422 | URL 不匹配 | 确认 URL 域名正确 |
| 429 | 请求过多 | 等待后重试 |
脚本位置: ${CLAUDE_SKILL_ROOT}/scripts/indexnow.sh
| 命令 | 说明 |
|---|---|
| ------ | ------ |
generate-key | 生成 API key 和验证文件 |
submit | 提交一个或多个 URL |
submit-sitemap [path] | 从本地 sitemap 提取并提交 |
submit-sitemap-url | 从远程 sitemap 提取并提交 |
status | 显示当前配置状态 |
.indexnow-key 文件建议加入 .gitignorepublic/{key}.txt 验证文件需提交到版本控制并部署更多 AI SEO 技能详见:https://domainrank.app/ai-seo-skills
共 1 个版本