feat(supporters): 템플릿화 — 병원 고유값을 데이터로 분리하고 templates/supporters-astro 내보내기

- src/data/site.json 신설(매체 이름·로고·홈 큐레이션), factSheet에 kind·areaLabel·transitShort·transitNote·reservationUrl·doctorsUrl·youtube.title 추가
- lib.ts: PENDING('확인 대기')·v()·has()·surface()·editor() 도입, 스키마는 빈 값을 빼고 생성
- 페이지·컴포넌트 15개에서 뷰성형외과 하드코딩 제거, 빈 데이터 empty-state (글 0편·영상 0건·뉴스 0건·이미지 없음)
- 검증: 28페이지 표시 텍스트·구조 지문 이전 빌드와 동일(홈 title 마침표 1건만 정정), JSON-LD 차이는 빈 sameAs 제거뿐
- scripts/export_template.mjs + scripts/template/data(빈 데이터 세트) → templates/supporters-astro (빈 데이터로 10페이지 0오류 빌드, 게이트 통과)
- 게이트 픽스처를 자체 authors로 분리해 템플릿에서도 테스트 통과, 구조 기준선의 글 상세 페이지는 사전순 첫 글로 동적 선택

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Haewon KamandClaude Fable 5.1 committed 2026-09-07 14:07:14 +09:00
1 parent 49c5e46f23
commit 622441e6aa
100 files changed
+6886 -174

No files matched your search

+2 -2
View File
@@ -1,6 +1,6 @@
---
import { fact } from '../lib';
import { fact, SITE_NAME, v } from '../lib';
---
<p class="disclosure">
뷰 서포터즈 활동은 {fact.shortName}의 지원을 받습니다. 이 글에는 다른 환자의 치료 경험담과 전후 사진을 싣지 않습니다. {fact.sideEffectNotice}
{SITE_NAME} 활동은 {v(fact.shortName, '병원')}의 지원을 받습니다. 이 글에는 다른 환자의 치료 경험담과 전후 사진을 싣지 않습니다. {fact.sideEffectNotice}
</p>
+11 -9
View File
@@ -1,17 +1,19 @@
---
import { fact } from '../lib';
import { fact, v, has } from '../lib';
const f = fact as Record<string, any>;
const rows = f.hours?.rows ?? [];
interface Props { compact?: boolean }
const { compact = false } = Astro.props;
---
<aside class="fact-block" aria-label="병원 기본 정보">
<h2>{fact.shortName} 기본 정보</h2>
<h2>{v(f.shortName, '병원')} 기본 정보</h2>
<dl>
<dt>정식 명칭</dt><dd>{fact.name}</dd>
<dt>주소</dt><dd>{fact.address.full}</dd>
<dt>전화</dt><dd><a href={`tel:${fact.phone.replace(/-/g, '')}`}>{fact.phone}</a></dd>
<dt>진료시간</dt><dd>{fact.hours.rows.map((r) => r.open ? `${r.days} ${r.open}~${r.close}` : `${r.days} ${r.note}`).join(' · ')}</dd>
<dt>가는 길</dt><dd>{fact.transit}</dd>
{!compact && <><dt>개원</dt><dd>{fact.founded}년</dd><dt>규모</dt><dd>{fact.building.summary}</dd></>}
<dt>정식 명칭</dt><dd>{v(f.name)}</dd>
<dt>주소</dt><dd>{v(f.address?.full)}</dd>
<dt>전화</dt><dd>{has(f.phone) ? <a href={`tel:${f.phone.replace(/-/g, '')}`}>{f.phone}</a> : v(f.phone)}</dd>
<dt>진료시간</dt><dd>{rows.length ? rows.map((r: any) => r.open ? `${r.days} ${r.open}~${r.close}` : `${r.days} ${r.note}`).join(' · ') : v(null)}</dd>
<dt>가는 길</dt><dd>{v(f.transit)}</dd>
{!compact && <><dt>개원</dt><dd>{has(f.founded) ? `${f.founded}년` : v(null)}</dd><dt>규모</dt><dd>{v(f.building?.summary)}</dd></>}
</dl>
<p style="margin:0.8rem 0 0;font-size:0.8rem;color:var(--slate-500)">진료시간 출처: <a href={fact.hours.source} rel="noopener">{fact.hours.sourceLabel}</a>. 주소·전화는 <a href={fact.address.source} rel="noopener">공식 홈페이지 표기</a>를 따릅니다. 이 정보는 {fact.checkedAt}에 확인했고 다음 확인 예정일은 {fact.nextCheck}입니다.</p>
<p style="margin:0.8rem 0 0;font-size:0.8rem;color:var(--slate-500)">진료시간 출처: {has(f.hours?.source) ? <a href={f.hours.source} rel="noopener">{f.hours.sourceLabel}</a> : v(null)}. 주소·전화는 {has(f.address?.source) ? <a href={f.address.source} rel="noopener">공식 홈페이지 표기</a> : '공식 홈페이지 표기'}를 따릅니다. 이 정보는 {v(f.checkedAt, '확인일 미정')}에 확인했고 다음 확인 예정일은 {v(f.nextCheck, '미정')}입니다.</p>
</aside>
+3 -3
View File
@@ -1,11 +1,11 @@
---
import { CATEGORY_LABELS, supporter } from '../lib';
import { CATEGORY_LABELS, supporter, site as S, fact } from '../lib';
interface Props { post: any }
const { post } = Astro.props;
const d = post.data;
const v0 = d.videos?.[0] ?? d.video;
const thumb = d.thumbnail ?? d.hero?.src ?? (v0 ? `https://i.ytimg.com/vi/${v0.id}/hqdefault.jpg` : '/img/clinic/building-clean.jpg');
const thumbAlt = d.hero?.alt ?? (v0 ? `유튜브 영상 썸네일: ${v0.title}` : '뷰성형외과 빌딩 외관');
const thumb = d.thumbnail ?? d.hero?.src ?? (v0 ? `https://i.ytimg.com/vi/${v0.id}/hqdefault.jpg` : S.buildingImage?.src ?? '/favicon.svg');
const thumbAlt = d.hero?.alt ?? (v0 ? `유튜브 영상 썸네일: ${v0.title}` : S.buildingImage?.alt ?? `${fact.shortName} 건물 외관`);
---
<article class="card has-thumb">
<a class="thumb" href={`/posts/${post.id}`}><img src={thumb} alt={thumbAlt} loading="lazy" /></a>
+1 -1
View File
@@ -8,7 +8,7 @@ const p = reviewer ? physician(reviewer) : null;
<section class="review-box" aria-label="작성·감수 정보">
{p?.image ? <img src={p.image} alt={`${p.name} ${p.title}`} width="56" height="56" /> : <div class="avatar">{a.name.slice(0, 1)}</div>}
<div>
<div><strong>작성</strong> <a href={`/authors/${author}`}>{a.name}</a> · {a.role} · 정정 요청 <a href="mailto:o2oteam@o2o.kr">o2oteam@o2o.kr</a></div>
<div><strong>작성</strong> <a href={`/authors/${author}`}>{a.name}</a> · {a.role} {a.email ? <> · 정정 요청 <a href={`mailto:${a.email}`}>{a.email}</a></> : <> · 정정 요청은 <a href="/corrections">정정 기록</a> 페이지 안내를 따릅니다</>}</div>
{p && status === 'reviewed' ? (
<div><strong>의학 검토</strong> {p.name} {p.title} <span class="badge reviewed">검토 완료 {dateModified}</span></div>
) : (
+3 -1
View File
@@ -1,6 +1,8 @@
---
// 유튜브 라이트 임베드: 썸네일(i.ytimg.com) + 재생 버튼. 클릭 시 iframe으로 교체. 헤드리스·저속 환경에서도 시각적으로 보인다.
import { surface } from '../lib';
interface Props { id: string; title: string; speaker?: string; published?: string; note?: string; compact?: boolean }
const handle = surface('youtube').handle ? `유튜브 ${surface('youtube').handle}` : '유튜브';
const { id, title, speaker, published, note, compact = false } = Astro.props;
---
<figure class={`yt ${compact ? 'compact' : ''}`}>
@@ -10,7 +12,7 @@ const { id, title, speaker, published, note, compact = false } = Astro.props;
</button>
<figcaption>
<strong>{title}</strong>
<span>{speaker ? `${speaker} · ` : ''}{published ? `${published} 게시 · ` : ''}유튜브 @ViewclinicKR{note ? ` · ${note}` : ''}</span>
<span>{speaker ? `${speaker} · ` : ''}{published ? `${published} 게시 · ` : ''}{handle}{note ? ` · ${note}` : ''}</span>
</figcaption>
</figure>
<script>