feat(supporters): 영어 화면의 병원 고유 사실을 데이터에서 읽도록 바꾸고 템플릿 재생성

templates/supporters-astro 는 supporters/ 에서 만들어지는 파생물인데, 정본이 된
supporters/ 코드에 뷰 고유 사실이 문장으로 박혀 있었다. 그대로 내보내면 다른 병원
사이트에 틀린 사실이 나간다. 빈 데이터로 빌드해 보니 실제로
"Founded 확인 대기 · Sinnonhyeon Station Exit 3" 가 나왔다.

데이터로 바꾼 곳 (전부 factSheetEn.json 에 이미 있던 값이다)
- 히어로 이미지 alt: site.json 의 heroImageAltEn 을 읽고, 없으면 한국어 alt 를 쓴다.
- 히어로 칩: 설립연도와 위치를 데이터에 있는 것만 잇는다. 둘 다 없으면 칩을 내지 않는다.
- 방문 카드 요약: factSheetEn 의 airportShort 가 있을 때만 경로를 적는다.
- 병원 카드 요약: 설립연도와 factSheetEn 의 building 첫 문장을 데이터에서 잇는다.
- 공항 카드: factSheetEn 의 airport 가 있을 때만 카드를 낸다.
- 영문 플래너 병원명: factSheetEn 의 shortName 을 읽고, 영문 표기가 없는 병원은
  한국어 상호를 쓴다.
- 404 안내: 상호를 factSheet 에서 읽는다.

템플릿 빈 데이터셋에 factSheetEn.json 이 없어서 뷰의 영문 사실이 통째로 남고 있었다.
빈 factSheetEn.json 을 만들고 site.json 에 heroImageAltEn 자리를 넣었다.

export_template.mjs 의 누락 검사가 상호만 찾아 지명으로 적힌 사실을 놓쳤다.
지명·건물 표현을 패턴에 넣고, 문장을 그리는 코드(src/pages·layouts·components·lib)만
내보내기를 멈추게 하고 데이터·빌드 도구는 알림만 하도록 나눴다. 빌드 도구의 기본 인자
때문에 검사가 늘 실패해 신호가 되지 못하던 문제도 함께 풀린다.

검증
- 빈 데이터 템플릿 빌드 14페이지, 영어 홈에 병원 고유 사실 0건, 사실을 말하던 조각은
  생략되고 요약문만 일반 문장으로 남는다.
- 뷰 사이트 빌드 32페이지, 영어 홈의 칩·공항 카드·요약문이 모두 그대로 나온다.
- 게이트 41/41 통과, check.mjs 오류 0건(경고 23건은 기존 건).
- 루트 tsc --noEmit 0 에러, 내보내기 종료코드 0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Haewon KamandClaude Opus 5 committed 2026-09-12 14:27:57 +09:00
1 parent f01bc6cafc
commit e60ef04503
21 files changed
+472 -332

No files matched your search

+3 -2
View File
@@ -1,7 +1,8 @@
---
// 없는 주소. Vercel 이 dist/404.html 을 자동으로 쓴다. 옛 주소(/recovery, /stay)는 vercel.json 리다이렉트가 /plan 으로 먼저 보낸다.
import Base from '../layouts/Base.astro';
import { SITE_NAME } from '../lib';
import { SITE_NAME, fact, v } from '../lib';
const f = fact as Record<string, any>;
const site = Astro.site!.toString().replace(/\/$/, '');
const ld = { '@type': 'WebPage', '@id': `${site}/404#page`, name: '페이지를 찾을 수 없음', url: `${site}/404`, inLanguage: 'ko', isPartOf: { '@id': `${site}/#website` }, publisher: { '@type': 'Organization', name: SITE_NAME, url: site } };
---
@@ -9,7 +10,7 @@ const ld = { '@type': 'WebPage', '@id': `${site}/404#page`, name: '페이지를
<section class="section dark" style="padding:5rem 0 4.5rem"><div class="wrap-wide">
<div class="sec-head"><div class="eyebrow" style="color:var(--purple-300)">404</div><h1 class="serif" style="font-size:2rem;display:inline-block;background:linear-gradient(to right,var(--purple-300),var(--blue-300));-webkit-background-clip:text;background-clip:text;color:transparent">Page Not Found</h1><p class="sub">주소가 바뀌었거나 없는 페이지입니다. 아래에서 이어서 보실 수 있습니다.</p></div>
<div class="grid">
<a class="card" href="/" style="text-decoration:none"><div class="cat">Home</div><h3>홈</h3><p>뷰성형외과를 알아보는 분들의 질문과 답</p></a>
<a class="card" href="/" style="text-decoration:none"><div class="cat">Home</div><h3>홈</h3><p>{v(f.shortName, '병원')} 정보를 알아보는 분들의 질문과 답</p></a>
<a class="card" href="/plan" style="text-decoration:none"><div class="cat">Recovery Planner</div><h3>회복 일정</h3><p>수술일 기준 입국·출국 계산과 회복기 외출 계획. 영어 화면은 /en/plan</p></a>
<a class="card" href="/visit" style="text-decoration:none"><div class="cat">Visit</div><h3>방문 안내</h3><p>예약, 가는 길, 주차, 도착 후 동선</p></a>
</div>
+23 -5
View File
@@ -8,6 +8,24 @@ import VisitMap from '../../components/VisitMap.astro';
const f = fact as Record<string, any>;
const site = Astro.site!.toString().replace(/\/$/, '');
const yt = surface('youtube'); const gu = surface('gangnamunni'); const gg = surface('google');
// 카드 요약문은 factSheetEn.json 에서만 만든다. 병원마다 다른 사실(공항 경로·건물)을 문장에 적어 두면
// 다른 병원 사이트에 그대로 나가 틀린 말이 된다. 값이 없으면 그 조각을 빼고 일반 문장만 남긴다.
const airportShort = String((EN as Record<string, any>).airportShort || '');
const buildingShort = String((EN as Record<string, any>).building || '').split('. ')[0];
const visitCard = airportShort
? `${airportShort}, opening hours by day, and where to go when you arrive.`
: 'How to reach the clinic, opening hours by day, and where to go when you arrive.';
const clinicCard = [
has(f.founded) && `Founded ${f.founded}`,
buildingShort || null,
'specialties, and where reviews can be read',
].filter(Boolean).join(', ') + '.';
const heroAlt = String((S as Record<string, any>).heroImageAltEn || S.heroImage?.alt || '');
// 히어로 칩. 설립연도와 위치는 병원마다 다르므로 데이터에 있는 것만 잇는다. 둘 다 없으면 칩을 내지 않는다.
const chipFacts = [
has(f.founded) && `Founded ${f.founded}`,
has((EN as Record<string, any>).areaLabel) && String((EN as Record<string, any>).areaLabel),
].filter(Boolean).join(' · ');
const hoursDays = EN.hoursDays as Record<string, string>;
const ld = [
{ '@type': 'WebPage', '@id': `${site}/en#page`, name: `${EN.shortName} Supporters (English)`, url: `${site}/en`, inLanguage: 'en', isPartOf: { '@id': `${site}/#website` }, about: { '@id': `${fact.url}/#clinic` } },
@@ -23,7 +41,7 @@ const ld = [
<h1>{EN.shortName},<br /><span class="accent">plan your stay before you fly.</span></h1>
<p class="lede">{EN.shortName} is a {EN.kind} at {EN.areaLabel}{has(f.founded) && <>, founded in {f.founded}</>}. This site is run by supporters who answer the questions people ask before visiting. In English you can plan your recovery stay, find the way here and check clinic facts. Articles are in Korean.</p>
<div class="chips">
<span class="chip"><span class="dot"></span>Founded {v(f.founded)} · Sinnonhyeon Station Exit 3</span>
{chipFacts && <span class="chip"><span class="dot"></span>{chipFacts}</span>}
<span class="chip"><span class="dot"></span>Based on the clinic's published guidance</span>
</div>
<div style="display:flex;gap:0.8rem;flex-wrap:wrap;margin-top:1.6rem">
@@ -31,7 +49,7 @@ const ld = [
<a class="btn secondary" href="#visit">Getting here</a>
</div>
</div>
{has(S.heroImage?.src) && <div class="hero-img collage"><img src={S.heroImage.src} alt="View Plastic Surgery building exterior and interior collage: consultation center, operating room, surgery center corridor" width={S.heroImage.width} height={S.heroImage.height} /></div>}
{has(S.heroImage?.src) && <div class="hero-img collage"><img src={S.heroImage.src} alt={heroAlt} width={S.heroImage.width} height={S.heroImage.height} /></div>}
</div>
</section>
@@ -39,8 +57,8 @@ const ld = [
<div class="sec-head"><div class="eyebrow">Start Here</div><h2>Where Are You Now?</h2><p class="sub">Pick the step that matches where you are.</p></div>
<div class="grid">
<a class="card entry" href="/en/plan"><div class="cat">Surgery date set</div><h3>Plan arrival, departure and recovery days</h3><p>Choose your procedure and date. See when to arrive, the earliest you can fly home, which days you can go out, and hotels near the clinic.</p><span class="more">Open the Recovery Planner</span></a>
<a class="card entry" href="#visit"><div class="cat">Preparing to visit</div><h3>Airport to clinic, hours and parking</h3><p>Line 9 from Gimpo Airport with no transfer, opening hours by day, and where to go when you arrive.</p><span class="more">Getting here</span></a>
<a class="card entry" href="#clinic"><div class="cat">Checking the clinic</div><h3>Facts, building and reviews</h3><p>Founded {v(f.founded)}, 19-storey clinic building, specialties, and where reviews can be read.</p><span class="more">Clinic facts</span></a>
<a class="card entry" href="#visit"><div class="cat">Preparing to visit</div><h3>Airport to clinic, hours and parking</h3><p>{visitCard}</p><span class="more">Getting here</span></a>
<a class="card entry" href="#clinic"><div class="cat">Checking the clinic</div><h3>Facts, building and reviews</h3><p>{clinicCard}</p><span class="more">Clinic facts</span></a>
</div>
</div></section>
@@ -58,7 +76,7 @@ const ld = [
<div class="sec-head"><div class="eyebrow">Visit</div><h2>Getting Here</h2><p class="sub">Address, transit, airport route, opening hours and what to do when you arrive.</p></div>
<div class="grid">
<div class="card"><div class="cat">Address</div><h3>{EN.address.full}</h3><p>{EN.transit}</p><p><a href={`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(EN.address.mapQuery)}`} rel="noopener" target="_blank">Open in Google Maps</a></p></div>
<div class="card"><div class="cat">From the airport</div><h3>Incheon to Sinnonhyeon</h3><p>{EN.airport}</p></div>
{has(EN.airport) && <div class="card"><div class="cat">From the airport</div><h3>Airport to the clinic</h3><p>{EN.airport}</p></div>}
<div class="card"><div class="cat">On arrival</div><h3>Where to go in the building</h3><p>{EN.arrival}</p><p>{EN.parking}</p></div>
</div>
<VisitMap lang="en" hideHead nameEn={EN.shortName} addressEn={EN.address.full} />
+4 -1
View File
@@ -3,8 +3,11 @@
import Base from '../../layouts/Base.astro';
import Planner from '../../components/Planner.astro';
import { fact, SITE_NAME, clinicSchema, v } from '../../lib';
import EN from '../../data/factSheetEn.json';
const f = fact as Record<string, any>;
const clinicEn = 'View Plastic Surgery';
// 영문 표기는 factSheetEn 에서 읽는다. 영문 표기를 확인하지 못한 병원은 한국어 상호를 그대로 쓴다.
const E = EN as Record<string, any>;
const clinicEn = String(E.shortName || E.name || f.shortNameEn || f.nameEn || f.shortName || SITE_NAME);
const site = Astro.site!.toString().replace(/\/$/, '');
const ld = [
{ '@type': 'WebPage', '@id': `${site}/en/plan#page`, name: `${clinicEn} Recovery Planner`, url: `${site}/en/plan`, inLanguage: 'en', isPartOf: { '@id': `${site}/#website` }, about: { '@id': `${fact.url}/#clinic` }, publisher: { '@type': 'Organization', name: SITE_NAME, url: site } },