Files
GiteaMailTemplates/docs/CONTRIBUTING.ko.md
T
KenanZhu d8a714b2b5 feat(preview): cross-browser scrollbar, keyboard nav, dev-mode client simulation, docs overhaul
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])
2026-06-04 16:01:42 +08:00

74 lines
2.6 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 기여 가이드 — Gitea 메일 템플릿
## 기여 방법
### 새 스타일 추가하기
1. 도구로 스캐폴드: `cd tools && go run . create <style-name>` — 11개 이메일 유형 모두에 대한 플레이스홀더 `.tmpl` 파일이 포함된 완전한 디렉토리 구조를 생성합니다
2. `themes/<style-name>/`에서 각 `.tmpl` 파일을 고유한 디자인으로 편집
3. 프리뷰 재생성: `cd tools && go run . preview all` (빌드 스크립트가 `themes/` 아래의 모든 테마 디렉토리를 자동으로 찾고 테마 선택기도 자동 생성합니다)
4. 스크린샷과 함께 PR 제출 (이미지당 50 KiB 이하, 10–20 KiB 권장)
### 스타일 가이드라인
- 각 스타일에 **11개 템플릿 유형 모두** 포함
- Gitea 내장 함수만 사용
- 번역 키는 Gitea 공식 로케일 (`mail.*`) 사용
- **`.DisplayName` 사용 금지** (collaborator, transfer, release, workflow_run, assigned, default)
- 600px 너비의 이메일 클라이언트에 맞게 디자인
- Gmail, Outlook, Apple Mail에서 테스트
### 버그 리포트
1. Go 변수가 올바른지 확인
2. 번역 키가 Gitea 로케일과 일치하는지 확인
3. `.DisplayName`이 오용되지 않았는지 확인
4. 프리뷰 재생성: `cd tools && go run . preview all`
5. 스타일 이름과 메일 유형을 명시하여 이슈 생성
---
## 개발 설정
- **Go 1.21+** 템플릿 렌더링 및 CLI 도구
- **Node.js 18+** (선택) 개발 서버 및 Juice CSS 인라인
### 로컬 프리뷰 (정적)
1. 데이터 생성: `cd tools && go run . preview all`
2. `preview/index.html`을 브라우저에서 열기
> [!WARNING]
> 정적 Gmail/Outlook 시뮬레이션은 참고용입니다. 비교적 정확한 렌더링은 dev 모드를 사용하세요.
### 개발 서버 (실시간 리로드 + CSS 인라인 + 클라이언트 시뮬레이션)
```bash
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 라이선스에 동의하게 됩니다.