- Split monolithic build-preview.go into modular packages: tools.go (entry), cli/ (list/create/delete/preview commands), config/ (JSON loading), preview/ (rendering engine, funcs, locale) - Extract all template metadata into data/templates_config.json as single source of truth — no hardcoded template data in Go - Replace hand-rolled CLI parsing with github.com/urfave/cli/v2 - Add sensible defaults for --folder (../themes) and --config (./data/templates_config.json) — most commands now run bare - Add type-coercing gt/lt/ge/le template funcs for JSON float64 - Fix AppUrl to gitea.com matching official template convention - rendered.js now exports __REGISTRY__ and __PARAMS__ alongside __RENDERED__ — preview/index.html reads all from single source - Cross-validate all 11 template data contexts against official Gitea source (services/mailer/*.go + templates/mail/*.tmpl) - Update all docs (README, AGENTS, CONTRIBUTING, 5 languages) to reflect new CLI workflow with create scaffolding command Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2.5 KiB
2.5 KiB
Gitea 郵件模板
為自託管 Gitea 實例精心設計、面向不同受眾的郵件模板集合。
110 個模板檔案 — 10 種視覺風格,每種 11 種郵件類型
設計理念
大多數自託管 Gitea 實例使用預設的純文字郵件模板。本專案提供了開箱即用、視覺精美的替代方案——每種方案都針對特定社群或受眾設計,您可以選擇最適合您使用者的風格。
每個模板都是直接替換。所有 Go 模板變數、翻譯鍵和 Gitea 資料上下文完全相容。無需修補程式、無需外掛、無需 fork。
風格展示
圖片為 600px 寬截圖,來自線上預覽。截圖方法參見 images/README.md。
安裝
選擇一種風格,將 mail/ 目錄複製到 Gitea 自訂模板路徑:
cp -r themes/horizon/mail/* /var/lib/gitea/custom/templates/mail/
systemctl restart gitea
切換風格只需覆蓋檔案,無需更改設定。
預覽
cd tools && go run . preview all
然後開啟 preview/index.html。
相容性
- Gitea 1.21+,100% 變數相容,僅使用內建函式和官方翻譯鍵
授權
MIT — 詳見 LICENSE。









