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])
2.9 KiB
2.9 KiB
コントリビューション — Gitea メールテンプレート
参加方法
新しいスタイルの追加
- ツールでスキャフォールド:
cd tools && go run . create <style-name>— 全11種類のメールタイプ用のプレースホルダ.tmplファイルを含む完全なディレクトリ構造を作成します themes/<style-name>/内の各.tmplファイルを独自デザインで編集- プレビューを再生成:
cd tools && go run . preview all(ビルドスクリプトがthemes/以下の全テーマを自動検出し、テーマセレクターも自動生成されます) - スクリーンショット付きで PR を提出(1枚あたり 50 KiB 以下、10–20 KiB 推奨)
スタイルガイドライン
- 各スタイルに 全11種類のテンプレート を含める
- Gitea 組み込み関数のみ使用
- 翻訳キーは Gitea 公式ロケール (
mail.*) から .DisplayNameを使用しない (collaborator, transfer, release, workflow_run, assigned, default)- 600px 幅のメールクライアント向けにデザイン
- Gmail, Outlook, Apple Mail でテスト
バグレポート
- Go 変数が正しいか確認
- 翻訳キーが Gitea ロケールと一致するか確認
.DisplayNameが誤用されていないか確認- プレビューを再生成:
cd tools && go run . preview all - スタイル名とメールタイプを明記して issue を作成
開発セットアップ
- Go 1.21+ テンプレートレンダリングとCLI用
- Node.js 18+(任意)開発サーバーとJuice CSSインライン用
ローカルプレビュー(静的)
- データを生成:
cd tools && go run . preview all preview/index.htmlをブラウザで開く
Warning
静的Gmail/Outlookシミュレーションは参考用です。比較的正確なレンダリングにはdevモードを使用してください。
開発サーバー(ライブリロード + CSSインライン + クライアントシミュレーション)
cd tools && go run . dev
# → http://localhost:3456
.tmpl ファイルを編集すると自動的に再構築されブラウザに反映されます。
Note
Dev シミュレーションは各メールクライアントのレンダリングを完全には再現できません — 参考用です。実際のクライアントで必ず確認してください。
結合テスト
Gitea にデプロイ: Site Administration > Configuration > Mailer > Send Test Email
コミット規約
style(<name>):— スタイルのテンプレート変更preview:— プレビューツールの変更tools:— Go ビルドスクリプトの変更docs:— ドキュメントと翻訳fix:— バグ修正project:— README, LICENSE, メタファイル
ライセンス
貢献により、MIT ライセンスに同意したものとみなします。