preview/index.html: - Fix scrollbar CSS: scoped webkit pseudo-elements + standards-track fallback, removed deprecated overflow:overlay - Keyboard navigation: arrows cycle focus between Theme/Template/Client selects, up/down select within focused dropdown, d/m toggle viewport - Dev/static mode detection: delayed static warning only when WebSocket absent, WebSocket errors only on disconnect (not on initial fail) - iframe sandbox: removed static sandbox attr, applied dynamically only in dev mode (file: protocol rejects sandboxed srcdoc) - Loading fix: removed double-toggle between init and render(); added 5s safety timeout - Transform clean: returns HTML as-is; CSS stripping moved to server-side - Dev disclaimer: blue info banner shown on WebSocket connect tools/server/inliner.mjs: - Added stripGmail() / stripOutlook() — server-side CSS property stripping for email client simulation tools/server/server.mjs: - Fixed WebSocket upgrade: use app.listen() instead of createServer(app).listen() - Juice post-processing now generates three rendered.js variants (modern/gmail/outlook) - Initial startup runs juice-only pass (avoids duplicate Go compilation) docs/ (all 6 languages — en, zh-CN, zh-TW, ja, ko, ru): - Image size limits: max 50KiB, recommended 10-20KiB - Dev disclaimer: simulation cannot 100% reproduce every client - Changed 'accurate' to 'relatively accurate' across all static-mode warnings - Converted all plain blockquotes to GitHub admonitions ([!WARNING] / [!NOTE])
3.2 KiB
3.2 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。
Warning
静态模式下 Gmail/Outlook 模拟仅供参考,使用 dev 模式可获得相对准确的 CSS 内联渲染。
开发服务器(实时重载 + Juice CSS 内联 + Gmail/Outlook 模拟):
cd tools && go run . dev # 需要 Node.js
# → http://localhost:3456
Note
Dev 模拟无法 100% 还原各个邮件客户端的渲染差异,仅供参考,请以实际效果为准。
| 功能 | 静态 | Dev |
|---|---|---|
| Go 模板渲染 | ✅ | ✅ |
| 主题/模板切换 | ✅ | ✅ |
| Juice CSS 内联 | — | ✅ |
| Gmail/Outlook CSS 剥离 | — | ✅ |
| 实时重载 | — | ✅ |
| 需要 Node.js | — | ✅ |
兼容性
- Gitea 1.21+,100% 变量兼容,仅使用内置函数和官方翻译键
许可证
MIT — 详见 LICENSE。









