feat: 首页 Go SSR 与 React hydrate 同构,消壳层与帖行闪动

补齐侧栏/右栏图标与徽章、鉴权种子、StaticFeedList,并修正嵌套 a 与标题徽章对齐。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-01 07:07:38 +08:00
parent 9e134916a4
commit 44eed97fe0
26 changed files with 2530 additions and 159 deletions

View File

@@ -209,11 +209,8 @@ func (h *Handlers) ServePublicSPA(c *gin.Context) {
OGType: "website",
OGImage: defaultImage,
}, siteName, siteKeywords)
if isBot {
c.Data(http.StatusOK, "text/html; charset=utf-8", []byte(h.botBoardHTML(meta, *board)))
return
}
embed_static.ServeSPAWithMeta(c, meta)
// 板块首页:真人与爬虫共用完整首屏 HTML
h.serveFeedDocument(c, meta, board.ID)
return
}
@@ -291,10 +288,10 @@ func (h *Handlers) ServePublicSPA(c *gin.Context) {
return
}
// 其余已知路由SPA + head meta首页对爬虫额外返回可读正文
// 其余已知路由SPA + head meta首页/Feed 返回完整首屏 HTML
meta := h.buildSPAPageMeta(c, path, brand, base, siteName, defaultImage)
if isBot && (path == "/" || path == "") {
c.Data(http.StatusOK, "text/html; charset=utf-8", []byte(h.botHomeHTML(meta, brand)))
if path == "/" || path == "" {
h.serveFeedDocument(c, meta, 0)
return
}
embed_static.ServeSPAWithMeta(c, meta)