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:
1 parent
f01bc6cafc
commit
e60ef04503
21 files changed
+472
-332
No files matched your search
@@ -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>
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
---
|
||||
// 영어 홈. 헤더의 언어 전환(KO/EN)이 도착하는 곳. 구성은 한국어 홈과 같은 섹션 리듬(라이트 히어로 → 틴트 카드 → 다크 통계 → 라이트 → 다크)이고,
|
||||
// 내용은 영어로 읽을 수 있는 것만 싣는다: 회복 일정 플래너, 오는 길, 진료시간, 병원 사실, 원칙. 한국어 글은 번역 없이 링크만 안내한다.
|
||||
import Base from '../../layouts/Base.astro';
|
||||
import { fact, site as S, clinicSchema, surface, has, v } from '../../lib';
|
||||
import EN from '../../data/factSheetEn.json';
|
||||
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` } },
|
||||
clinicSchema(site),
|
||||
];
|
||||
---
|
||||
<Base lang="en" title={`${EN.shortName}, Seoul · Recovery planner, getting here, clinic facts`} description={`${EN.shortName} is a ${EN.kind} at ${EN.areaLabel}, founded in ${v(f.founded)}. Plan your recovery stay around your surgery date, find the way from the airport, and check opening hours and clinic facts in English.`} jsonLd={ld} alternates={[{ lang: 'ko', href: '/' }, { lang: 'en', href: '/en' }]}>
|
||||
<section class="hero-light">
|
||||
<div class="blob a"></div><div class="blob b"></div>
|
||||
<div class="wrap-wide inner">
|
||||
<div>
|
||||
<div class="eyebrow">{S.siteNameEn || 'VIEW SUPPORTERS'} · English</div>
|
||||
<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">
|
||||
{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">
|
||||
<a class="btn primary" href="/en/plan">Recovery Planner</a>
|
||||
<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={heroAlt} width={S.heroImage.width} height={S.heroImage.height} /></div>}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section tint" style="padding:3.2rem 0"><div class="wrap-wide">
|
||||
<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>{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>
|
||||
|
||||
<section class="section dark"><div class="wrap-wide">
|
||||
<div class="sec-head"><div class="eyebrow" style="color:var(--purple-300)">At A Glance</div><h2>Clinic In Numbers</h2><p class="sub">Figures from the clinic's public profiles. Dates checked are shown with each number.</p></div>
|
||||
<div class="stats">
|
||||
<div class="stat"><b>{v(f.founded)}</b><span class="label">Founded</span><span class="desc">{EN.areaLabel}. {EN.building}</span></div>
|
||||
<div class="stat"><b>{v(gu.doctors)}</b><span class="label">Doctors listed</span><span class="desc">Gangnam Unni clinic profile, checked {v(gu.checked)}</span></div>
|
||||
<div class="stat"><b>{v(yt.videos)}</b><span class="label">Doctor videos</span><span class="desc">Official YouTube channel (Korean), checked {v(yt.checked)}</span></div>
|
||||
<div class="stat"><b>{v(gu.reviews)}</b><span class="label">Reviews on Gangnam Unni</span><span class="desc">We link to where reviews can be read and do not reproduce patient stories.</span></div>
|
||||
</div>
|
||||
</div></section>
|
||||
|
||||
<section class="section light" id="visit"><div class="wrap-wide">
|
||||
<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>
|
||||
{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} />
|
||||
<h3 style="margin-top:2rem">Opening hours</h3>
|
||||
<div class="table-wrap"><table><thead><tr><th>Day</th><th>Hours</th></tr></thead><tbody>
|
||||
{(f.hours?.rows ?? []).map((r: any) => <tr><td>{hoursDays[r.days] ?? r.days}</td><td>{r.open ? `${r.open} to ${r.close}` : EN.hoursClosed}</td></tr>)}
|
||||
</tbody></table></div>
|
||||
<p style="font-size:0.88rem;color:var(--slate-500)">Source: {has(f.hours?.source) ? <a href={f.hours.source} rel="noopener">clinic profile</a> : 'clinic'}. Hours can change, so call or message before you travel.</p>
|
||||
<p style="margin-top:1.2rem"><a class="btn primary" href={f.reservationUrl || f.url} rel="noopener">Book a consultation</a> {has(f.urlEn) && <a class="btn secondary" href={f.urlEn} rel="noopener">Official English website</a>}</p>
|
||||
</div></section>
|
||||
|
||||
<section class="section tint" id="clinic"><div class="wrap-wide">
|
||||
<div class="sec-head"><div class="eyebrow">Fact Sheet</div><h2>Clinic Facts</h2><p class="sub">What the clinic states publicly, with the date we checked.</p></div>
|
||||
<div class="grid">
|
||||
<div class="card"><div class="cat">Specialties</div><h3>What the clinic does</h3><ul style="margin:0;padding-left:1.1rem;font-size:0.93rem;color:var(--slate-600)">{EN.specialties.map((s) => <li>{s}</li>)}</ul></div>
|
||||
<div class="card"><div class="cat">Contact</div><h3>{EN.name}</h3><p>Tel {v(f.phone)}{has(f.kakao) && <> · <a href={f.kakao} rel="noopener">KakaoTalk channel</a></>}</p><p>{has(f.url) && <a href={f.url} rel="noopener">Korean website</a>}{has(f.urlEn) && <> · <a href={f.urlEn} rel="noopener">English website</a></>}</p></div>
|
||||
<div class="card"><div class="cat">Reviews</div><h3>Where to read them</h3><p>{has(gu.url) && <a href={gu.url} rel="noopener">Gangnam Unni</a>}{has(gu.rating) && <> rating {gu.rating}, {v(gu.reviews)} reviews</>}{has(gg.url) && <> · <a href={gg.url} rel="noopener">Google Maps</a>{has(gg.rating) && <> rating {gg.rating}</>}</>}. We do not quote individual patient stories.</p></div>
|
||||
</div>
|
||||
</div></section>
|
||||
|
||||
<section class="section dark"><div class="wrap-wide">
|
||||
<div class="sec-head"><div class="eyebrow" style="color:var(--purple-300)">Principles</div><h2>What We Do, What We Don't</h2><p class="sub">Three rules so you can judge for yourself.</p></div>
|
||||
<div class="grid">
|
||||
<div class="card"><h3>How we answer</h3><p>One question, one article, the answer first. Medical content is reviewed by the clinic's attending surgeon and the review date is shown. Articles are in Korean.</p></div>
|
||||
<div class="card"><h3>What we leave out</h3><p>Before-and-after photos, other patients' stories, comparisons with other clinics, and any promise of results. For reviews we only say where they can be read.</p></div>
|
||||
<div class="card"><h3>What we disclose</h3><p>Who wrote each piece, whether a surgeon reviewed it, what sources were used, and that this site is supported by {EN.shortName}.</p></div>
|
||||
</div>
|
||||
</div></section>
|
||||
</Base>
|
||||
<style>
|
||||
.card.entry { text-decoration: none; color: inherit; }
|
||||
.card .more { font-size: 0.85rem; font-weight: 600; color: var(--accent); }
|
||||
</style>
|
||||
@@ -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 = (fact as Record<string, any>).nameEn || (fact as Record<string, any>).shortNameEn || (fact as Record<string, any>).shortName || 'the clinic';
|
||||
// 영문 표기는 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 } },
|
||||
|
||||
@@ -17,7 +17,7 @@ const ld = [
|
||||
clinicSchema(site),
|
||||
];
|
||||
---
|
||||
<Base title={`${clinic}, ${(S.heroTitle || '궁금한 것부터 답합니다').replace(/\.$/, '')}`} description={`${clinic}${has(f.areaLabel) ? `(${f.areaLabel})` : ''}를 알아보는 분들이 실제로 묻는 질문을 골라, 원장 설명 영상과 병원 공개 자료를 근거로 답합니다. 글마다 작성자와 원장 감수 여부를 밝힙니다.`} jsonLd={ld}>
|
||||
<Base title={`${clinic}, ${(S.heroTitle || '궁금한 것부터 답합니다').replace(/\.$/, '')}`} description={`${clinic}${has(f.areaLabel) ? `(${f.areaLabel})` : ''}를 알아보는 분들이 실제로 묻는 질문을 골라, 원장 설명 영상과 병원 공개 자료를 근거로 답합니다. 글마다 작성자와 원장 감수 여부를 밝힙니다.`} jsonLd={ld} alternates={[{ lang: 'ko', href: '/' }, { lang: 'en', href: '/en' }]}>
|
||||
<section class="hero-light">
|
||||
<div class="blob a"></div><div class="blob b"></div>
|
||||
<div class="wrap-wide inner">
|
||||
|
||||
@@ -11,6 +11,7 @@ export const GET: APIRoute = async ({ site }) => {
|
||||
{ loc: `${base}/posts`, lastmod: today },
|
||||
{ loc: `${base}/clinic`, lastmod: today },
|
||||
{ loc: `${base}/visit`, lastmod: today },
|
||||
{ loc: `${base}/en`, lastmod: today },
|
||||
{ loc: `${base}/plan`, lastmod: today },
|
||||
{ loc: `${base}/en/plan`, lastmod: today },
|
||||
{ loc: `${base}/newsroom`, lastmod: today },
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import Base from '../layouts/Base.astro';
|
||||
import Gallery from '../components/Gallery.astro';
|
||||
import VisitMap from '../components/VisitMap.astro';
|
||||
import '../styles/plan.css';
|
||||
import { fact, site as S, SITE_NAME, clinicSchema, reservationUrl, v, has } from '../lib';
|
||||
const f = fact as Record<string, any>;
|
||||
const clinic = v(f.shortName, '병원');
|
||||
@@ -38,14 +39,17 @@ const ld = [
|
||||
<h2>4. 도착하면</h2>
|
||||
<p>{v(S.arrivalGuide, `도착 후 동선은 병원 확인 뒤 싣습니다. ${v(null)}.`)} 층별 구성 전체는 <a href="/clinic">병원 정보</a>에 있습니다.</p>
|
||||
|
||||
<div class="plan-entry">
|
||||
<h2>외국에서 오신다면: 회복 일정 플래너</h2>
|
||||
<p>시술과 수술일을 고르면 입국 권장일, 출국 가능 최소일, 회복기 동안 외출할 수 있는 날과 갈 만한 곳, 병원 근처 숙소를 한 화면에서 정리해 드립니다. 영어 화면도 있습니다.</p>
|
||||
<a class="btn primary" href="/plan">일정표 만들기</a>
|
||||
</div>
|
||||
|
||||
<h2>5. 상담 전에 읽어볼 글</h2>
|
||||
<ul>
|
||||
{(S.visitReads ?? []).map((r) => <li><a href={r.href}>{r.title}</a> {r.note}</li>)}
|
||||
{!(S.visitReads ?? []).length && <li>검토를 마친 글부터 차례로 연결합니다.</li>}
|
||||
</ul>
|
||||
<h2>6. 해외에서 오시는 경우</h2>
|
||||
<p>수술 전후에 머무는 동안의 숙박·식사·회복·관광 정보를 영문으로 정리했습니다. <a href="/en/plan" hreflang="en">Recovery Planner</a>.</p>
|
||||
|
||||
<p style="margin-top:2rem">{has(reservationUrl) && <a class="btn primary" href={reservationUrl} rel="noopener">{clinic} 상담 예약</a>}</p>
|
||||
<p class="disclosure">{fact.sideEffectNotice}</p>
|
||||
</article>
|
||||
|
||||
Reference in new issue
Block a user