# AGENTS.md — Gitea Mail Templates ## Project Overview A curated collection of email template themes (10 visual styles) for self-hosted Gitea instances. Each theme contains 11 Go `html/template` files covering all Gitea notification email types. ## Repository Layout ``` themes/ # Template themes (5 styles, 11 .tmpl each = 55 source files) horizon/ # Enterprise / Corporate terminal/ # Developers / Tech ember/ # Community / Open Source bloom/ # Creative / Startup (glassmorphism) heritage/ # Education / Research tools/ # Go build tooling build-preview.go # Pre-renders all templates into preview/rendered.js go.mod # Go module (stdlib only, zero dependencies) preview/ # Browser-based live preview index.html # SPA with style/template/client/viewport switching rendered.js # Pre-rendered HTML (generated, committed for clone-and-preview) docs/ # Multi-language documentation ``` ## Working With Templates ### Template Files - All `.tmpl` files use Go `html/template` syntax - Must use only Gitea's built-in template functions: `AppUrl`, `DotEscape`, `QueryEscape`, `ShortSha`, `HTMLFormat`, `PathEscapeSegments`, `FileSize` - Must use only official Gitea translation keys (`mail.*` namespace) - Never reference `.DisplayName` in templates where the data context lacks it (collaborator, transfer, release, workflow_run, assigned, default) - Each style must have all 11 template types ### Adding a New Theme 1. Create `themes//` with the full `mail/` directory structure 2. Write all 11 `.tmpl` files with unique visual design 3. Run `go run ./tools/build-preview.go` to regenerate preview data 4. Add the theme to the `