diff --git a/MAIN_PLAN.md b/MAIN_PLAN.md index 642a87c..7df377c 100644 --- a/MAIN_PLAN.md +++ b/MAIN_PLAN.md @@ -279,6 +279,32 @@ - 구현: 기존 `buildExtrasForPage`/`buildZip` 경로 사용(추가 구현 불필요) - 브랜치/PR: `feat/zip-validation-phase5` → CI 트리거 및 자동 머지 대상 +### 폰트 최적화(TDD) +- 테스트: `lib/exporter/font.optimization.test.ts` + - head에 ``, `` 존재 검증 + - CSS에 `system-ui` 폴백 포함 검증 +- 구현: `lib/exporter/html.ts` + - head에 googleapis/gstatic preconnect 추가 + - CSS body `font-family`에 system-ui 폴백 유지 +- 브랜치/PR: `feat/font-optimization` → CI 트리거 및 자동 머지 대상(automerge 라벨 조건) + +### 폼 제출: Google Sheets 템플릿 Export 포함(TDD) +- 테스트: `lib/exporter/sheets.template.test.ts` + - actionUrl 미지정 시 ZIP extras에 `sheets/Code.gs`, `sheets/README.txt` 포함 검증 + - actionUrl 지정 시 extras에 포함되지 않음 검증 +- 구현: `lib/exporter/extras.ts` + - `buildExtrasForPage(page)`로 extras 생성 + - Apps Script Code.gs/README.txt 기본 템플릿 제공 +- 브랜치/PR: `feat/form-sheets-template` → CI 트리거 및 자동 머지 대상(automerge 라벨 조건) + +### site.webmanifest/robots.txt 자동 생성(TDD) +- 테스트: `lib/exporter/manifest.robots.auto.test.ts` + - extras에 `site.webmanifest`/`robots.txt` 자동 포함 검증 + - manifest 파생 키 검사(name/short_name/start_url/display/theme_color) +- 구현: `lib/exporter/extras.ts` + - `buildExtrasForPage(page)`에서 robots.txt/manifest 자동 생성 및 포함 +- 브랜치/PR: `feat/manifest-robots-auto` → CI 트리거 및 자동 머지 대상(automerge 라벨 조건) + ## 의사결정 기록(ADR) - [YYYY-MM-DD] Next.js(App Router) 채택: 생태계/배포/서버리스/SEO 편의성. - [YYYY-MM-DD] Sheets 기본 방안: Apps Script 웹앱 템플릿(사용자 편의/트래픽 분산). diff --git a/lib/exporter/html.ts b/lib/exporter/html.ts index 4ff9c78..24c33e8 100644 --- a/lib/exporter/html.ts +++ b/lib/exporter/html.ts @@ -254,6 +254,8 @@ function buildHead(page: Page) { + + ${escapeHtml(page.seo.title)} diff --git a/lib/exporter/manifest.link.tokens.test.ts b/lib/exporter/manifest.link.tokens.test.ts new file mode 100644 index 0000000..3c72170 --- /dev/null +++ b/lib/exporter/manifest.link.tokens.test.ts @@ -0,0 +1,21 @@ +import { describe, it, expect } from 'vitest' +import { exportPage } from '@/lib/exporter/html' +import { pageSchema, type Page } from '@/lib/schema/page' + +function makePage(): Page { + return pageSchema.parse({ + title: 'Head Links', + locale: 'en', + theme: { primaryColor: '#2563eb', fontFamily: 'Inter' }, + sections: [], + form: { actionUrl: '', fields: [], spamProtection: { honeypotFieldName: '_hp', minSubmitSeconds: 2 } }, + seo: { title: 't', description: 'd' }, + }) +} + +describe('Exporter - head 링크 토큰', () => { + it('site.webmanifest 링크를 포함한다', () => { + const out = exportPage(makePage()) + expect(out.html).toMatch(//) + }) +})