Files
jiang13-forum/.cursor/rules/rebuild-gitea-ssr.mdc
freefire 1414c71dec docs+feat: 重构规格与 Gitea 式 SSR 骨架(首页)
在 rebuild/gitea-ssr 落地产品规格、Cursor 规则,以及 Go 模板 SSR 首页/板块列表;未迁移路径仍回落 SPA,便于对照 main。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-29 03:11:25 +08:00

33 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
description: Gitea 式 SSR 重构总则rebuild/gitea-ssr 分支)
alwaysApply: true
---
# Gitea 式 SSR 重构
## 分支
- 功能开发在 **`rebuild/gitea-ssr`****不要**把破坏性 SSR 替换推到 `main`。
- `main` 保留 React SPA用作对照checkout / worktree
## 渲染
- 公开页(首页、板块、帖详情、用户页等)必须用 **Go `html/template` 服务端渲染完整 HTML**。
- 禁止为已迁移公开页恢复 React SPA 空壳;禁止「用户 SPA + 爬虫专用 HTML」双轨作为长期方案。
- JSON `/api` 仅用于交互增强与管理后台,**不得**作为公开页首屏唯一数据来源。
## 架构参照
对齐 [Gitea](https://github.com/go-gitea/gitea) 职责划分:
- `routers/web` — HTML 页面路由
- `templates/` — 模板
- `web_src/` → `public/assets/` — 渐进增强 CSS/JS
- 现有 `service/`、`model/` 可复用业务逻辑
细节见 [`docs/rebuild-spec/08-gitea-ssr-architecture.md`](docs/rebuild-spec/08-gitea-ssr-architecture.md)。
## 产品规格
实现功能前按 [`docs/rebuild-spec/README.md`](docs/rebuild-spec/README.md) 阅读顺序核对;业务规则以 `05-business-rules.md` 为准。