feat: 新增 IndexNow 批量提交接口(主页 + 专题)
POST /api/web/seopush/indexnow/bulk?limit=10
- 组装主页 "/" 和前 N-1 个专题(playlet_theme 按 Rank 降序)URL
- 调用 pub/seo/indexnow.BatchIndexNowSubmitter 提交到 api.indexnow.org
- 返回提交的 URL 列表 + IndexNow 回执(含各引擎 HTTP 状态码)
- Admin 鉴权(走 /api/web/* 的 auth 中间件)
部署前提:
- web.yaml 配置 indexNow.key
- Web 根目录可访问 /{key}.txt(内容为 key 本身)作为 IndexNow 域名验证
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -95,6 +95,7 @@ func registerRouter(router *gin.Engine) {
|
||||
homeConfigRouter(rootRouter)
|
||||
feedbackRouter(rootRouter)
|
||||
contactUsRouter(rootRouter)
|
||||
seopushRouter(rootRouter)
|
||||
}
|
||||
// 第三方回调路由(免鉴权,挂在 engine 上而非 /api/web 分组)
|
||||
thirdRouter(router)
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"hkdj-web-server/web/api/web_seopush"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func seopushRouter(root *gin.RouterGroup) {
|
||||
group := root.Group("/seopush")
|
||||
{
|
||||
group.POST("/indexnow/bulk", web_seopush.SubmitHomeAndThemes)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user