Files
jiang13-forum/.cursor/rules/rebuild-templates.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

14 lines
723 B
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: Go HTML 模板约定SSR
globs: templates/**/*
alwaysApply: false
---
# 模板约定
- 布局:`base.tmpl` + 各页定义 `content` 等 block或 `{{template}}` 组合);保持片段小而可复用。
- **默认转义**`{{.Title}}` 等普通插值;用户生成 HTML 必须先经现有消毒(如 `SanitizePostHTML`),再用显式安全函数输出,禁止随意放开。
- 静态资源走 `/ssr-assets/...``public/assets` 嵌入),不要写死外链 CDN除非产品规格要求
- 页面数据通过 handler 组装的 view model 传入;模板内不做复杂业务判断。
- 中文 UI 文案可写在模板;与品牌相关的站点名等从 settings/view 传入。