Files
jiang13-forum/.cursor/rules/rebuild-templates.mdc
freefire fde5f628ec feat: opaque session、安装/发帖 SSR 与最小 Admin 后台
浏览器登录改为 DB sessions(可吊销);敏感词与 OIDC PEM 入 settings;
落地安装向导、注册发帖与 /admin 仪表盘/板块/审核/设置。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-29 05:44:16 +08:00

15 lines
726 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
---
# 模板约定
- 目录对齐 Gitea`templates/base/`、`home/`、`post/`、`shared/`、`status/`、`auth/`,根级 `install.tmpl` / `post-install.tmpl`。
- 页面入口用固定 `{{define "home"}}` / `{{define "post"}}` 等显式 `{{template "base/head"}}`…;**禁止** `{{template .Name}}`(标准库不支持动态名)。
- **默认转义**;用户 HTML 须先消毒 + 门控后再 `{{safeHTML ...}}`。
- 静态资源 `/ssr-assets/...`。
- 浏览器写操作走 `routers/web` 表单 POST + CSRF`webctx`),不依赖 JSON `/api`。
- 中文文案可写在模板;站点名等从 PageChrome / settings 传入。