chore(init): scaffold Gitea mail templates — 110 templates, 10 visual styles, drop-in deployment

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
KenanZhuandClaude Opus 4.8 committed 2026-06-03 18:10:22 +08:00
commit a2742887e8
140 files changed
+8747

No files matched your search

+66
View File
@@ -0,0 +1,66 @@
# 貢獻指南 — Gitea 郵件模板
## 參與方式
### 新增風格
1. 建立風格目錄:`themes/<風格名稱>/`
2. 從現有風格複製目錄結構
3. 以獨特的視覺設計實作全部 11 個 `.tmpl` 檔案
4. 在 `tools/build-preview.go` 的 `themes` 切片中新增主題
5. 重新產生預覽:`go run ./tools/build-preview.go`
6. 在 `preview/index.html` 的 `<select id="sel-theme">` 中新增選項
7. 提交包含螢幕截圖的 PR
### 風格指南
- 每個風格必須包含全部 **11 種模板類型**
- 僅使用 Gitea 內建模板函式
- 翻譯鍵必須來自 Gitea 官方語系檔案(`mail.*` 命名空間)
- **請勿在以下模板中使用 `.DisplayName`**:collaborator、transfer、release、workflow_run、assigned、default
- 針對 600px 寬度的郵件用戶端設計
- 盡可能在 Gmail、Outlook、Apple Mail 中測試
### 回報 Bug
1. 檢查引用的 Go 模板變數是否存在
2. 驗證翻譯鍵是否與 Gitea 語系檔案相符
3. 確認 `.DisplayName` 未在不支援的模板中使用
4. 重新產生預覽:`go run ./tools/build-preview.go`
5. 提交 issue,註明風格名稱、郵件類型及錯誤描述
### 改善文件
文件改進、預覽螢幕截圖、安裝指南和翻譯始終歡迎。
---
## 開發環境
無需建置工具或依賴。
### 本機預覽
1. 先生成預覽資料:`go run ./tools/build-preview.go`
2. 在瀏覽器中開啟 `preview/index.html`
3. 在 Modern、Gmail、Outlook、Raw source 模式間切換驗證效果
### 整合測試
將模板部署至 Gitea 實例,使用管理後台的測試郵件功能:
**Site Administration > Configuration > Mailer > Send Test Email**
---
## 提交規範
- `style(<名稱>):` — 特定風格的模板變更
- `preview:` — 預覽工具變更
- `tools:` — Go 建置腳本變更
- `docs:` — 文件與翻譯
- `fix:` — Bug 修復
- `project:` — README、LICENSE、中繼資料檔案
## 授權條款
參與貢獻即表示您同意將您的貢獻以 MIT 授權條款授權。