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

@@ -0,0 +1,45 @@
---
import Base from '../layouts/Base.astro';
import { fact, SITE_NAME, editor, reservationUrl, v, has } from '../lib';
const ed = editor();
const clinic = v(fact.shortName, '병원');
const site = Astro.site!.toString().replace(/\/$/, '');
const ld = { '@type': 'AboutPage', '@id': `${site}/about#page`, name: '이 사이트에 대해', url: `${site}/about`, inLanguage: 'ko', isPartOf: { '@id': `${site}/#website` }, publisher: { '@type': 'Organization', name: SITE_NAME, url: site } };
---
<Base title="이 사이트에 대해" description={`${SITE_NAME}는 ${clinic}를 알아보는 분들의 질문에 원장 영상과 공개 자료를 근거로 답하는 곳입니다. 누가 쓰고 누가 감수하는지, 무엇을 싣지 않는지, 병원과의 관계를 밝힙니다.`} jsonLd={ld}>
<article class="wrap" style="padding-bottom:4rem">
<header class="article-head"><div class="eyebrow">About</div><h1 class="serif">About This Site</h1><p style="color:var(--slate-600);margin-top:0.6rem">누가 쓰는지, 무엇을 근거로 하는지, 무엇을 싣지 않는지.</p></header>
<h2>어떤 곳인가요</h2>
<p>{SITE_NAME}는 {clinic}를 알아보는 분들이 실제로 묻는 질문에 답하는 곳입니다. 병원 홈페이지가 병원을 소개한다면, 이곳은 "가기 전에 뭘 알아야 하지?", "이 수술은 어떻게 진행되지?", "후기는 어디서 보지?" 같은 환자 쪽 질문에서 출발합니다.</p>
<h2>답은 무엇을 근거로 하나요</h2>
<ul>
<li>{clinic} 원장들이 직접 설명한 유튜브 영상. 글에서 원장이 한 말은 영상을 함께 붙여 직접 확인할 수 있게 합니다.</li>
<li>병원이 공개한 자료. 홈페이지, 강남언니 병원 페이지, 언론 보도.</li>
<li>주소, 전화, 진료시간 같은 기본 정보는 <a href="/clinic">병원 정보</a> 페이지와 같은 내용을 씁니다.</li>
</ul>
<p>글마다 맨 아래 "참고한 자료"에 링크와 확인한 날짜를 적습니다.</p>
<h2>누가 쓰고 누가 확인하나요</h2>
<p>글은 {SITE_NAME} 편집자 {ed.name}이 쓰고 편집 책임을 집니다. 의학적인 내용은 {clinic} 담당 원장이 검토하며, 검토가 끝난 글에는 "검토 완료"와 날짜를, 아직 검토 전인 글에는 "검토 대기"를 표시합니다. 편집자는 의학적 판단을 하지 않습니다. 수술 여부와 방법은 반드시 전문의 상담으로 정하세요.</p>
<h2>싣지 않는 것</h2>
<ul>
<li>전후 사진</li>
<li>다른 환자의 후기와 경험담. 후기는 강남언니, 구글, 네이버 플레이스의 집계 수치와 링크로만 안내합니다.</li>
<li>다른 병원과의 비교, 효과를 보장하는 표현, "최고" 같은 최상급 표현</li>
<li>가격. 이벤트 가격은 병원과 강남언니 페이지로 안내만 합니다.</li>
</ul>
<p>이유는 간단합니다. 병원의 지원을 받는 사이트가 경험담이나 전후 사진으로 설득하면 광고가 되고, 읽는 분이 판단할 근거가 아니라 인상만 남기 때문입니다.</p>
<h2>병원과의 관계</h2>
<p>{SITE_NAME} 활동은 {clinic}의 지원을 받습니다. 이 사실은 모든 글 아래에 같은 문장으로 표시합니다. 감춘 광고가 아니라는 뜻이며, 그래서 위의 "싣지 않는 것"을 지킵니다.</p>
<h2>정정 요청과 문의</h2>
<p>글의 오류나 정정 요청은 편집 책임자 {ed.name}에게 {ed.email ? <>이메일 <a href={`mailto:${ed.email}`}>{ed.email}</a>로</> : <>이메일로(주소 {v(null)})</>} 보내 주세요. 접수한 요청과 처리 결과는 <a href="/corrections">정정 기록</a>에 날짜와 함께 남깁니다. 진료·예약 문의는 {clinic} 공식 채널로 하세요. {has(fact.url) && <a href={fact.url} rel="noopener">홈페이지</a>}{has(fact.kakao) && <> · <a href={fact.kakao} rel="noopener">카카오톡 상담 채널</a></>} · 전화 {v(fact.phone)}</p>
<p style="font-size:0.88rem;color:var(--slate-500);margin-top:2.5rem">이 사이트를 만드는 방식(글 구조, 중복 콘텐츠 규칙, 발행 전 검사)이 궁금한 운영자는 <a href="/editorial">편집 기준</a>을 보세요.</p>
<p class="disclosure">{fact.sideEffectNotice}</p>
</article>
</Base>
@@ -0,0 +1,19 @@
---
import { getCollection } from 'astro:content';
import Base from '../../layouts/Base.astro';
import PostCard from '../../components/PostCard.astro';
import { authors, personSchema } from '../../lib';
export async function getStaticPaths() {
return Object.keys(authors.supporters).map((id) => ({ params: { id } }));
}
const { id } = Astro.params;
const a = (authors.supporters as Record<string, any>)[id!];
const posts = (await getCollection('posts')).filter((p) => p.data.author === id);
const site = Astro.site!.toString().replace(/\/$/, '');
---
<Base title={`${a.name} · 작성 글`} description={a.bio} jsonLd={personSchema(id!, site)}>
<div class="wrap-wide" style="padding-bottom:4rem">
<header class="article-head"><div class="eyebrow">{a.role}</div><h1>{a.name}</h1><p style="color:var(--slate-600);margin-top:0.6rem;max-width:640px">{a.bio}</p></header>
<div class="grid">{posts.map((p) => <PostCard post={p} />)}</div>
</div>
</Base>
@@ -0,0 +1,45 @@
---
import Base from '../layouts/Base.astro';
import FactBlock from '../components/FactBlock.astro';
import { fact, site as S, clinicSchema, physicianSchema, physician, surface, v, has } from '../lib';
import Gallery from '../components/Gallery.astro';
const f = fact as Record<string, any>;
const clinic = v(f.shortName, '병원');
const docIds = (S.clinicDoctors ?? []).filter((id) => physician(id));
const docs = docIds.map(physician);
const site = Astro.site!.toString().replace(/\/$/, '');
const ld = [clinicSchema(site), ...docIds.slice(0, 1).map(physicianSchema)];
const yt = surface('youtube'); const gu = surface('gangnamunni'); const blog = surface('blog');
---
<Base title={`${clinic} 기본 정보`} description={`${v(f.name, clinic)}의 주소·전화·진료시간·층별 구성·진료과·공개 이력을 한 곳에 정리했습니다. 방문 전에 확인하세요.`} jsonLd={ld}>
<article class="wrap" style="padding-bottom:4rem">
<header class="article-head"><div class="eyebrow">Fact Sheet</div><h1 class="serif">Fact Sheet</h1><p style="color:var(--slate-600);margin-top:0.6rem"><strong style="color:var(--primary-900)">{clinic} 기본 정보.</strong> 주소, 전화, 진료시간, 층별 안내, 의료진을 한 곳에 모았습니다. 항목마다 어디서 확인한 정보인지 출처를 적어 두었습니다.</p></header>
<FactBlock />
<h2>진료시간</h2>
<div class="table-wrap"><table><thead><tr><th>요일</th><th>진료</th></tr></thead><tbody>{(f.hours?.rows ?? []).map((r: any) => <tr><td>{r.days}</td><td>{r.open ? `${r.open} ~ ${r.close}` : r.note}</td></tr>)}{!(f.hours?.rows ?? []).length && <tr><td colspan="2">{v(null)}</td></tr>}</tbody></table></div>
<p style="font-size:0.88rem;color:var(--slate-500)">출처: {has(f.hours?.source) ? <a href={f.hours.source} rel="noopener">{f.hours.sourceLabel}</a> : v(null)}. 진료시간은 바뀔 수 있으니 방문 전 전화로 한 번 더 확인하세요.</p>
<h2>건물과 층별 구성</h2>
{has(S.buildingImage?.src) && <figure class="figure"><img src={S.buildingImage.src} alt={S.buildingImage.alt} /><figcaption>{S.buildingImage.caption}</figcaption></figure>}
<p>{has(f.building?.summary) ? `${f.building.summary}입니다.` : `건물 규모 ${v(null)}.`}</p>
<div class="table-wrap"><table><thead><tr><th>층</th><th>용도</th></tr></thead><tbody>{(f.building?.floors ?? []).map((fl: any) => <tr><td>{fl.floor}</td><td>{fl.use}</td></tr>)}{!(f.building?.floors ?? []).length && <tr><td colspan="2">{v(null)}</td></tr>}</tbody></table></div>
{S.clinicGallery?.length > 0 && <Gallery cols={3} items={S.clinicGallery} />}
<h2>진료과와 진료 분야</h2>
<p>진료과: {(f.departments ?? []).join(', ') || v(null)}</p>
<p>진료 분야: {(f.specialties ?? []).join(', ') || v(null)}</p>
<h2>글과 영상에서 설명하는 의료진</h2>
{!docs.length && <p style="color:var(--slate-500)">의료진 정보는 병원이 확정한 담당 원장부터 싣습니다. {v(null)}.</p>}
{docs.map((p) => (<div class="doctor-strip">{p.image && <img src={p.image} alt={`${p.name} ${p.title}`} />}<div><div class="name">{p.name} <span style="font-weight:500;color:var(--slate-600)">{p.title}</span></div><p class="creds">{p.credentials.slice(0,3).join(' · ')} <a href={p.url} rel="noopener">프로필</a></p></div></div>))}
<p style="font-size:0.88rem;color:var(--slate-500)">전체 의료진 {v(gu.doctors)}명(강남언니 등록 기준)은 {has(f.doctorsUrl) ? <a href={f.doctorsUrl} rel="noopener">홈페이지 의료진 소개</a> : '홈페이지 의료진 소개'}에서 확인할 수 있습니다.</p>
<h2>병원이 공개한 이력</h2>
<ul>{(f.recognitions ?? []).map((r: any) => <li>{r.text} <a href={r.source} rel="noopener" style="font-size:0.85rem">(출처)</a></li>)}{!(f.recognitions ?? []).length && <li>{v(null)}</li>}</ul>
<h2>공식 채널</h2>
<ul>
<li>홈페이지: {has(f.url) ? <a href={f.url} rel="noopener">{f.url}</a> : v(null)}{has(f.urlEn) && <> (영문 <a href={f.urlEn} rel="noopener">{f.urlEn}</a>)</>}</li>
<li>유튜브: {has(yt.url) ? <a href={yt.url} rel="noopener">{yt.handle}</a> : v(null)} · 구독자 {v(yt.subscribers)} · 영상 {v(yt.videos)}개 ({v(yt.checked)} 기준)</li>
<li>강남언니: {has(gu.url) ? <a href={gu.url} rel="noopener">병원 페이지</a> : v(null)} · 평점 {v(gu.rating)} · 후기 {v(gu.reviews)}건 · 의료진 {v(gu.doctors)}명</li>
<li>카카오톡 채널: {has(f.kakao) ? <a href={f.kakao} rel="noopener">상담 채널</a> : v(null)}</li>
<li>블로그: {has(blog.url) ? <a href={blog.url} rel="noopener">{blog.url.replace(/^https?:\/\//, '').replace(/\/$/, '')}</a> : v(null)}{has(blog.note) && <> ({blog.note})</>}</li>
</ul>
<p class="disclosure">{fact.sideEffectNotice}</p>
</article>
</Base>
@@ -0,0 +1,24 @@
---
// 정정 기록. 무엇을 언제 왜 고쳤는지 공개한다. 정정 요청 경로와 처리 담당자를 명시한다.
import Base from '../layouts/Base.astro';
import data from '../data/corrections.json';
import { SITE_NAME, v } from '../lib';
const site = Astro.site!.toString().replace(/\/$/, '');
const items = [...data.items].sort((a, b) => b.date.localeCompare(a.date));
const ld = { '@type': 'WebPage', '@id': `${site}/corrections#page`, name: '정정 기록', url: `${site}/corrections`, inLanguage: 'ko', isPartOf: { '@id': `${site}/#website` }, publisher: { '@type': 'Organization', name: SITE_NAME, url: site }, dateModified: items[0]?.date };
---
<Base title="정정 기록 · 정정 요청 방법" description={`${SITE_NAME} 글의 정정 기록과 정정 요청 방법. 무엇을 언제 왜 고쳤는지 날짜와 함께 공개합니다.`} jsonLd={ld}>
<article class="wrap" style="padding-bottom:4rem">
<header class="article-head"><div class="eyebrow">Corrections</div><h1 class="serif">Corrections</h1><p style="color:var(--slate-600);margin-top:0.6rem"><strong style="color:var(--primary-900)">정정 기록.</strong> 글에서 고친 내용을 날짜와 이유와 함께 남깁니다.</p></header>
<h2>정정 요청 방법</h2>
<p>글의 오류, 오래된 수치, 근거가 다른 내용을 발견하면 편집 책임자 {v(data.owner)}에게 {data.contact ? <>이메일 <a href={`mailto:${data.contact}`}>{data.contact}</a>로</> : <>이메일로(주소 {v(null)})</>} 보내 주세요. 어느 글의 어느 문장인지와 근거 자료를 함께 주시면 빠릅니다. 접수한 요청은 확인 뒤 이 페이지에 처리 결과를 남깁니다. 진료·예약 문의는 병원 공식 채널로 하세요.</p>
<h2>정정 기록</h2>
<div class="table-wrap"><table><thead><tr><th>날짜</th><th>페이지</th><th>무엇이 문제였나</th><th>어떻게 고쳤나</th><th>계기</th></tr></thead><tbody>
{!items.length && <tr><td colspan="5" style="color:var(--slate-500)">아직 정정한 내용이 없습니다.</td></tr>}
{items.map((c) => <tr><td style="white-space:nowrap">{c.date}</td><td><a href={c.page}>{c.page}</a></td><td>{c.what}</td><td>{c.fix}</td><td>{c.source}</td></tr>)}
</tbody></table></div>
<p style="font-size:0.88rem;color:var(--slate-500)">글마다 하단의 "갱신 기록"에도 같은 변경이 날짜와 함께 표시됩니다.</p>
</article>
</Base>
@@ -0,0 +1,84 @@
---
// 운영자용 페이지. 병원 담당자·서포터즈·INFINITH가 보는 편집 기준이다. 고객 내비게이션에는 넣지 않고 푸터에서만 연결하며, 색인하지 않는다.
import Base from '../layouts/Base.astro';
import { fact, SITE_NAME } from '../lib';
const site = Astro.site!.toString().replace(/\/$/, '');
const ld = { '@type': 'WebPage', '@id': `${site}/editorial#page`, name: '편집 기준', url: `${site}/editorial`, inLanguage: 'ko', isPartOf: { '@id': `${site}/#website` }, publisher: { '@type': 'Organization', name: SITE_NAME, url: site } };
---
<Base title="편집 기준 (운영자용)" description={`${SITE_NAME} 운영자용 편집 기준. 질문 뱅크, 글 구조, 원천 변환 규칙, 중복 콘텐츠 회피, 구조화 데이터, 발행 전 검사.`} jsonLd={ld} noindex>
<article class="wrap" style="padding-bottom:4rem">
<header class="article-head"><div class="eyebrow">Editorial Policy</div><h1 class="serif">Editorial Policy</h1><p style="color:var(--slate-600);margin-top:0.6rem">이 페이지는 병원 담당자, 서포터즈, INFINITH 운영진이 보는 문서입니다. 방문자에게 보이는 소개는 <a href="/about">이 사이트에 대해</a>에 따로 있습니다.</p></header>
<div class="notice">고객 화면에는 "AI가 인용하는 방식"이나 제작 원칙을 쓰지 않습니다. 방문자는 답을 보러 오지 제작 과정을 보러 오지 않습니다. 이 페이지의 내용은 이 페이지 밖으로 내보내지 않습니다.</div>
<h2>1. 왜 이 사이트인가</h2>
<p>답변엔진(ChatGPT, Perplexity, 네이버 AI 브리핑)은 광고 문장이 아니라 질문에 바로 답하는 단락을 잘라 인용합니다. 병원 홈페이지는 소개 중심이라 그 단락이 없습니다. 이 사이트는 환자 질문에 답하는 단락을 먼저 만들고, 그 답을 원장 영상과 공개 자료로 뒷받침하는 것이 목적입니다.</p>
<h2>2. 질문 뱅크</h2>
<p>질문은 INFINITH가 실측한 환자 질문 뱅크 120문항(카테고리 A~G)에서 고릅니다. 문항 하나가 글 하나이고, 각 글의 문항 번호는 페이지 소스의 <code>data-qb</code> 속성에만 남기고 화면에는 표시하지 않습니다.</p>
<div class="table-wrap"><table><thead><tr><th>카테고리</th><th>내용</th><th>글 포맷</th></tr></thead><tbody>
<tr><td>A 병원 소개</td><td>어떤 병원인지, 의료진</td><td>정의문 + 사실 표</td></tr>
<tr><td>B 방문·예약</td><td>가는 길, 예약, 준비</td><td>체크리스트</td></tr>
<tr><td>C 선택 기준</td><td>병원·원장 고르는 기준</td><td>기준 표</td></tr>
<tr><td>D 시술 정보</td><td>수술 방법, 보형물, 회복</td><td>원장 영상 재구성 + FAQ</td></tr>
<tr><td>E 안전·신뢰</td><td>마취, 실명제, 응급</td><td>사실 나열 + 출처</td></tr>
<tr><td>F 가격·이벤트</td><td>가격 확인처</td><td>안내만, 금액 미기재</td></tr>
<tr><td>G 후기·평판</td><td>후기 읽는 곳</td><td>집계 수치 + 링크</td></tr>
</tbody></table></div>
<h2>3. 글 구조</h2>
<ol>
<li>H1은 질문형 한 문장.</li>
<li>첫 블록 "세 줄 요약"에 답을 먼저 쓴다. 답변엔진이 잘라 쓰는 단락이다.</li>
<li>본문 H2 3~5개. 표는 HTML table. 수치는 단위 포함.</li>
<li>원장 영상은 글로 재구성하고 원본을 임베드한다. 영상 설명란 텍스트는 복사하지 않는다.</li>
<li>FAQ 5~8개. 질문 뱅크 문항을 그대로 질문으로 쓴다.</li>
<li>작성·감수 정보, 참고 자료, 병원 정보 블록, 지원 관계 고지 순으로 닫는다.</li>
</ol>
<h2>4. 원천 변환 규칙</h2>
<ul>
<li>홈페이지 문장은 옮겨 적지 않는다. 사실(개원 연도, 층 구성, 진료시간)만 가져오고 문장은 새로 쓴다.</li>
<li>주소·전화·진료시간·의료진 수는 <code>src/data/factSheet.json</code> 한 곳에서만 가져온다. 화면의 <a href="/clinic">병원 정보</a>도 같은 파일에서 나온다.</li>
<li>이미지는 병원 공개 자료를 캡처해 쓰되, alt와 캡션은 글 문맥에 맞게 새로 쓰고 출처를 적는다.</li>
<li>후기 본문은 인용하지 않는다. 의료법 제56조가 광고에서 치료 경험담을 금지하고, 병원 지원을 받는 이 사이트는 광고로 볼 여지가 있다. 집계 수치와 링크만 쓴다.</li>
</ul>
<h2>5. 중복 콘텐츠를 피하는 규칙</h2>
<div class="table-wrap"><table><thead><tr><th>규칙</th><th>이유</th></tr></thead><tbody>
<tr><td>홈페이지 문장 40자 연속 일치 검사 후 발행</td><td>구글이 복제 사이트로 분류하거나 홈페이지와 순위를 나눠 갖는 일을 막는다.</td></tr>
<tr><td>허브(이 사이트)에 먼저 발행, 네이버 블로그는 24시간 뒤 요약 재작성</td><td>네이버 유사문서 판독은 뒤에 올라온 비슷한 글을 뺀다. 발행 순서가 원본 판정이다.</td></tr>
<tr><td>모든 페이지에 자기 참조 canonical</td><td>같은 글이 다른 주소로 복제돼도 원본이 한 곳으로 모인다.</td></tr>
<tr><td>홈페이지에 없는 정보 유형을 중심으로</td><td>준비 체크리스트, 회복 일정, 비교표, FAQ는 홈페이지가 다루지 않는 영역이다.</td></tr>
</tbody></table></div>
<h2>6. 구조화 데이터</h2>
<div class="table-wrap"><table><thead><tr><th>타입</th><th>용도</th></tr></thead><tbody>
<tr><td>Article + MedicalWebPage</td><td>글 본체. dateModified 필수</td></tr>
<tr><td>FAQPage</td><td>FAQ 블록</td></tr>
<tr><td>Person (author)</td><td>서포터즈. 확정 후 sameAs로 본인 SNS 연결</td></tr>
<tr><td>Physician (reviewedBy)</td><td>감수 원장. 감수 완료 상태에서만 넣는다. 감수 예정에 넣으면 허위 표기다</td></tr>
<tr><td>MedicalClinic (about)</td><td>{fact.shortName}. 홈페이지·유튜브·강남언니 sameAs</td></tr>
<tr><td>VideoObject</td><td>임베드 영상</td></tr>
</tbody></table></div>
<h2>7. 발행 전 검사</h2>
<p>정적 HTML로 빌드해 크롤러가 자바스크립트 없이 전문을 읽습니다. 빌드 뒤 <code>scripts/check.mjs</code>가 다음을 검사하고 하나라도 실패하면 배포하지 않습니다.</p>
<ol>
<li>JSON-LD 문법과 글 페이지의 Article/FAQPage 존재</li>
<li>모든 이미지의 alt</li>
<li>금칙 표현. 치료 결과를 단정하는 말, 부작용을 부정하는 문장, 최상급 병원 표현, 1인칭 경험담 어투. 목록은 <code>scripts/check.mjs</code>의 BANNED 배열에 있다</li>
<li>페이지당 H1 1개</li>
<li>홈페이지 문장 40자 연속 일치</li>
</ol>
<p>샘플 단계에서는 사이트 전체를 noindex로 두고, 이 페이지는 정식 오픈 뒤에도 noindex를 유지합니다.</p>
<h2>8. 고객 화면과 운영자 설명의 경계</h2>
<p>다음 표현은 고객 화면(홈, 글, 영상, 뉴스룸, 병원 정보, 소개)에 쓰지 않습니다.</p>
<ul>
<li>답변엔진, AI 인용, AEO/GEO, 질문 뱅크, QB 번호, INFINITH 실측</li>
<li>"홈페이지 문장을 복사하지 않습니다", "단일 원본", "수집 기준", "API 집계" 같은 제작 과정 설명</li>
<li>법 조문 번호. 고객에게는 "다른 환자의 경험담을 싣지 않습니다"까지만 말하고 이유는 한 문장으로 줄인다</li>
</ul>
<p>고객 화면에 남기는 것은 환자 보호 문구뿐입니다. 감수 상태, 참고 자료, 병원 지원 관계, 부작용 고지.</p>
</article>
</Base>
@@ -0,0 +1,108 @@
---
import { getCollection } from 'astro:content';
import Base from '../layouts/Base.astro';
import PostCard from '../components/PostCard.astro';
import FactBlock from '../components/FactBlock.astro';
import VideoLite from '../components/VideoLite.astro';
import Gallery from '../components/Gallery.astro';
import { SITE_NAME, fact, site as S, clinicSchema, surface, v, has, PENDING } from '../lib';
const posts = (await getCollection('posts')).sort((a, b) => b.data.dateModified.localeCompare(a.data.dateModified));
const site = Astro.site!.toString().replace(/\/$/, '');
const f = fact as Record<string, any>;
const clinic = v(f.shortName, '병원');
const area = has(f.areaLabel) ? `${f.areaLabel} 인근 ` : '';
const yt = surface('youtube'); const gu = surface('gangnamunni');
const ld = [
{ '@type': 'WebSite', '@id': `${site}/#website`, name: SITE_NAME, url: site, inLanguage: 'ko', about: { '@id': `${f.url}/#clinic` }, publisher: { '@type': 'Organization', name: SITE_NAME, url: site } },
clinicSchema(site),
];
---
<Base title={`${clinic}, ${(S.heroTitle || '궁금한 것부터 답합니다').replace(/\.$/, '')}`} description={`${clinic}${has(f.areaLabel) ? `(${f.areaLabel})` : ''}를 알아보는 분들이 실제로 묻는 질문을 골라, 원장 설명 영상과 병원 공개 자료를 근거로 답합니다. 글마다 작성자와 원장 감수 여부를 밝힙니다.`} jsonLd={ld}>
<section class="hero-light">
<div class="blob a"></div><div class="blob b"></div>
<div class="wrap-wide inner">
<div>
<div class="eyebrow">{S.eyebrow || SITE_NAME}</div>
<h1>{clinic},<br /><span class="accent">{S.heroTitle || '궁금한 것부터 답합니다.'}</span></h1>
<p class="lede">{clinic}는 {has(f.founded) ? `${f.founded}년 개원한 ` : ''}{area}{v(f.kind, '병원')}입니다. 이곳은 병원을 알아보는 분들이 실제로 묻는 질문을 골라, 원장 설명 영상과 병원이 공개한 자료를 근거로 답하는 곳입니다. 글마다 누가 썼고 원장 감수를 거쳤는지 밝힙니다.</p>
<div class="chips">
<span class="chip"><span class="dot"></span>{has(f.founded) ? `${f.founded}년 개원` : `개원 연도 ${PENDING}`} · {v(f.transitShort)}</span>
<span class="chip"><span class="dot"></span>원장이 직접 설명한 영상을 근거로</span>
</div>
<div class="hero .actions" style="display:flex;gap:0.8rem;flex-wrap:wrap;margin-top:1.6rem">
<a class="btn primary" href="/posts">전체 글 보기</a>
<a class="btn secondary" href="/clinic">병원 정보</a>
</div>
</div>
{has(S.heroImage?.src) && <div class="hero-img collage"><img src={S.heroImage.src} alt={S.heroImage.alt} 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">지금 상황에 맞는 곳에서 시작하세요.</p></div>
<div class="grid">
<a class="card entry" href="/posts#cat-D"><div class="cat">처음 알아볼 때</div><h3>어떤 수술인지 알고 싶어요</h3><p>방법의 차이와 상담에서 확인할 기준을 살펴보세요.</p><span class="more">시술 정보 글 보기</span></a>
<a class="card entry" href="/posts#cat-E"><div class="cat">병원을 선택할 때</div><h3>안전과 회복이 걱정돼요</h3><p>병원이 공개한 관리 체계와 담당 의료진에게 물어볼 질문을 확인하세요.</p><span class="more">안전·신뢰 글 보기</span></a>
<a class="card entry" href="/visit"><div class="cat">방문을 준비할 때</div><h3>예약과 방문 준비가 궁금해요</h3><p>예약 경로, 가는 길, 주차, 도착 후 동선을 순서대로 안내합니다.</p><span class="more">방문 안내 보기</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)">Why This Site</div><h2>Questions First</h2><p class="sub">병원에 가기 전에 알고 싶은 것부터 답합니다. 답은 원장이 직접 설명한 영상과 병원 공개 자료를 근거로 합니다.</p></div>
<div class="stats">
<div class="stat"><b>{posts.length}</b><span class="label">답한 질문</span><span class="desc">질문 하나에 글 하나. 첫 단락 "세 줄 요약"에 답을 먼저 쓰고, 그다음에 근거를 풉니다.</span></div>
<div class="stat"><b>{v(yt.videos)}</b><span class="label">원장 설명 영상</span><span class="desc">{v(yt.checked)} 확인. 글에서 원장이 한 말은 영상을 함께 붙여 두어 직접 확인할 수 있습니다.</span></div>
<div class="stat"><b>{v(gu.reviews)}</b><span class="label">강남언니 후기</span><span class="desc">{v(gu.checked)} 확인. 후기는 어디서 몇 건을 볼 수 있는지만 안내하고, 다른 환자의 경험담은 옮기지 않습니다.</span></div>
</div>
</div>
</section>
<section class="section light">
<div class="wrap-wide">
<div class="sec-head"><div class="row"><div><div class="eyebrow">Latest</div><h2>Recent Answers</h2><p class="sub">최근에 답한 질문. 첫 단락 "세 줄 요약"만 읽어도 답을 알 수 있습니다.</p></div><a href="/posts">전체 보기</a></div></div>
{posts.length ? <div class="grid">{posts.slice(0, 6).map((p) => <PostCard post={p} />)}</div> : <p class="sub" style="color:var(--slate-500)">아직 발행한 글이 없습니다. 검토를 마친 글부터 차례로 올립니다.</p>}
</div>
</section>
<section class="section tint">
<div class="wrap-wide">
<div class="sec-head"><div class="eyebrow">From The Doctors</div><h2>Doctors Explain</h2><p class="sub">원장이 직접 설명하는 영상. 이 사이트의 글은 이런 영상을 근거로 씁니다.</p></div>
{S.homeVideos?.length ? (
<div class="video-grid" style="grid-template-columns:repeat(auto-fill,minmax(300px,1fr))">
{S.homeVideos.map((vd) => <VideoLite id={vd.id} title={vd.title} published={vd.published} compact />)}
</div>
) : <p class="sub" style="color:var(--slate-500)">원장 설명 영상은 병원 공식 채널에서 골라 실을 예정입니다. {PENDING}.</p>}
</div>
</section>
<section class="section light">
<div class="wrap-wide">
<div class="sec-head"><div class="eyebrow">Inside</div><h2>Inside The Building</h2><p class="sub">{v(S.insideSummary, `시설 안내 ${PENDING}`)}</p></div>
{S.insideGallery?.length ? (
<>
<Gallery cols={3} items={S.insideGallery} />
<p style="font-size:0.83rem;color:var(--slate-500);margin-top:-0.6rem">{v(S.imageCredit, '사진 출처: 병원 공식 홈페이지')}</p>
</>
) : <p class="sub" style="color:var(--slate-500)">시설 사진은 병원 공식 홈페이지에서 허락받은 사진만 싣습니다. {PENDING}.</p>}
</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">읽는 분이 판단할 수 있도록 세 가지를 지킵니다.</p></div>
<div class="grid">
<div class="card"><h3>답하는 방식</h3><p>질문 하나에 글 하나. 첫 단락에 답을 먼저 씁니다. 의학적인 내용은 담당 원장이 감수하고, 감수가 끝난 글에는 날짜를, 아직인 글에는 감수 예정을 표시합니다.</p></div>
<div class="card"><h3>싣지 않는 것</h3><p>전후 사진, 다른 환자의 경험담, 다른 병원과의 비교, 효과를 보장하는 표현. 후기는 강남언니·구글에서 몇 건을 볼 수 있는지와 링크만 안내합니다.</p></div>
<div class="card"><h3>밝히는 것</h3><p>누가 썼는지, 원장 감수를 거쳤는지, 무엇을 참고했는지, 그리고 이 사이트가 {clinic}의 지원을 받는다는 사실. <a href="/about">이 사이트에 대해</a></p></div>
</div>
</div>
</section>
<section class="section tint"><div class="wrap-wide"><div class="sec-head"><div class="eyebrow">Fact Sheet</div><h2>Clinic Facts</h2><p class="sub">주소·전화·진료시간. 방문 전에 전화로 한 번 더 확인을 권합니다.</p></div><FactBlock /></div></section>
</Base>
<style>
.card.entry { text-decoration: none; color: inherit; }
.card.entry:hover { text-decoration: none; }
.card.entry .more { font-size: 0.85rem; font-weight: 600; color: var(--accent); }
</style>
@@ -0,0 +1,124 @@
---
import Base from '../layouts/Base.astro';
import news from '../data/news.json';
import { SITE_NAME, fact, site as S, v, PENDING } from '../lib';
const clinic = v(fact.shortName, '병원');
const items = news.items as { date: string; title: string; outlet: string; url: string; kind: 'release' | 'column' | 'mention'; origin: string; topic: string }[];
const site = Astro.site!.toString().replace(/\/$/, '');
const years = [...new Set(items.map((i) => i.date.slice(0, 4)))].sort().reverse();
const topics = [...new Set(items.map((i) => i.topic))];
const topicCount = Object.fromEntries(topics.map((t) => [t, items.filter((i) => i.topic === t).length]));
topics.sort((a, b) => topicCount[b] - topicCount[a]);
const KIND: Record<string, string> = { release: '보도자료', column: '원장 기고·인터뷰', mention: '언론 언급' };
const counts = { release: items.filter((i) => i.kind === 'release').length, column: items.filter((i) => i.kind === 'column').length, mention: items.filter((i) => i.kind === 'mention').length };
const outlets = new Set(items.map((i) => i.outlet)).size;
const ld = [
{ '@type': 'CollectionPage', '@id': `${site}/newsroom#page`, name: `${clinic} 뉴스룸`, url: `${site}/newsroom`, inLanguage: 'ko', about: { '@id': `${fact.url}/#clinic` }, publisher: { '@type': 'Organization', name: SITE_NAME, url: site }, ...(news.generatedAt ? { dateModified: news.generatedAt } : {}) },
{ '@type': 'ItemList', '@id': `${site}/newsroom#list`, name: `${clinic} 언론 보도 목록`, numberOfItems: items.length, itemListOrder: 'https://schema.org/ItemListOrderDescending', itemListElement: items.slice(0, 200).map((i, idx) => ({ '@type': 'ListItem', position: idx + 1, url: i.url, name: i.title })) },
];
---
<Base title={`뉴스룸 · ${clinic} 언론 보도 모음`} description={items.length ? `${clinic} 보도자료와 원장 기고·인터뷰, 언론 보도 ${items.length}건을 연도와 주제별로 모았습니다. ${years[years.length - 1]}년부터 ${years[0]}년까지, 매체 ${outlets}곳. 제목을 누르면 기사 원문으로 이동합니다.` : `${clinic} 보도자료와 원장 기고·인터뷰, 언론 보도를 연도와 주제별로 모읍니다. 기사 수집 ${PENDING}.`} jsonLd={ld}>
<section class="section dark" style="padding:3.5rem 0 3rem">
<div class="wrap-wide">
<div class="sec-head"><div class="eyebrow" style="color:var(--purple-300)">Newsroom</div><h1 class="serif" style="font-size:2rem;color:#fff;display:inline-block;background:linear-gradient(to right,var(--purple-300),var(--blue-300));-webkit-background-clip:text;background-clip:text;color:transparent">In The News</h1><p class="sub">{clinic} 보도자료와 원장 기고·인터뷰, 언론 보도를 연도와 주제별로 모았습니다. 제목을 누르면 기사 원문으로 이동합니다.</p></div>
<div class="stats">
<div class="stat"><b>{items.length.toLocaleString()}</b><span class="label">기사</span><span class="desc">{years.length ? `${years[years.length - 1]}년부터 ${years[0]}년까지` : PENDING}</span></div>
<div class="stat"><b>{counts.release.toLocaleString()}</b><span class="label">보도자료</span><span class="desc">병원이 직접 알린 소식. 수상, 장비 도입, 행사, 협약</span></div>
<div class="stat"><b>{counts.column.toLocaleString()}</b><span class="label">원장 기고·인터뷰</span><span class="desc">원장이 언론에 직접 설명한 수술 이야기</span></div>
<div class="stat"><b>{outlets}</b><span class="label">매체</span><span class="desc">{v(S.newsOutletsExample, PENDING)}</span></div>
</div>
</div>
</section>
<section class="section light" style="padding-top:2.5rem">
<div class="wrap-wide">
<div class="filters" id="filters">
<div class="fgroup"><span class="flabel">종류</span>
<button class="chipbtn active" data-kind="all">전체</button>
<button class="chipbtn" data-kind="release">보도자료 {counts.release}</button>
<button class="chipbtn" data-kind="column">기고·인터뷰 {counts.column}</button>
<button class="chipbtn" data-kind="mention">언론 언급 {counts.mention}</button>
</div>
<div class="fgroup"><span class="flabel">주제</span>
<button class="chipbtn active" data-topic="all">전체</button>
{topics.map((t) => <button class="chipbtn" data-topic={t}>{t} {topicCount[t]}</button>)}
</div>
<div class="fgroup"><span class="flabel">연도</span>
<div class="yearnav">{years.map((y) => <a href={`#y${y}`}>{y}</a>)}</div>
</div>
</div>
{!items.length && <p class="sub" style="color:var(--slate-500)">병원 게시판과 뉴스 검색에서 기사를 모은 뒤 싣습니다. {PENDING}.</p>}
{years.map((y) => {
const list = items.filter((i) => i.date.startsWith(y));
return (
<section class="year" id={`y${y}`} data-year={y}>
<div class="yearhead"><h2 class="serif" style="margin-top:0">{y}</h2><span class="ycount">{list.length}건</span></div>
<ol class="newslist">
{list.map((i) => (
<li class="newsitem" data-kind={i.kind} data-topic={i.topic}>
<span class="ndate">{i.date}</span>
<span class={`nkind ${i.kind}`}>{KIND[i.kind]}</span>
<a class="ntitle" href={i.url} rel="noopener nofollow" target="_blank">{i.title}</a>
<span class="noutlet">{i.outlet}</span>
<span class="ntopic">{i.topic}</span>
</li>
))}
</ol>
</section>
);
})}
<p class="disclosure">{v(S.newsNote, `${clinic} 홈페이지 게시판과 뉴스 검색에서 모은 기사입니다. 병원이 알리거나 원장이 설명한 기사만 모았고, 그 밖의 보도는 포함하지 않습니다.`)}</p>
</div>
</section>
</Base>
<style>
.filters { display: grid; gap: 0.7rem; margin-bottom: 2rem; background: var(--primary-50); border-radius: 16px; padding: 1.1rem 1.25rem; }
.fgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.flabel { font-size: 0.78rem; font-weight: 700; color: var(--slate-500); letter-spacing: 0.06em; margin-right: 0.3rem; min-width: 2.4em; }
.chipbtn { border: 1px solid var(--slate-200); background: #fff; color: var(--slate-600); border-radius: 999px; padding: 0.3rem 0.8rem; font-size: 0.82rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.chipbtn.active { background: linear-gradient(to right, var(--grad-start), var(--grad-end)); color: #fff; border-color: transparent; }
.yearnav { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.yearnav a { font-size: 0.82rem; font-weight: 600; color: var(--accent); padding: 0.2rem 0.5rem; border-radius: 6px; }
.yearnav a:hover { background: var(--st-good-bg); text-decoration: none; }
.year { margin: 0 0 2.2rem; scroll-margin-top: 90px; }
.year.hidden { display: none; }
.yearhead { display: flex; align-items: baseline; gap: 0.8rem; border-bottom: 2px solid var(--primary-900); padding-bottom: 0.4rem; margin-bottom: 0.6rem; }
.yearhead h2 { margin: 0; font-size: 1.8rem; }
.ycount { color: var(--slate-500); font-size: 0.85rem; font-weight: 600; }
.newslist { list-style: none; padding: 0; margin: 0; }
.newsitem { display: grid; grid-template-columns: 6.2em 6.4em 1fr auto auto; gap: 0.6rem 0.9rem; align-items: baseline; padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--slate-100); font-size: 0.93rem; }
.newsitem.hidden { display: none; }
.newsitem:hover { background: var(--primary-50); }
.ndate { color: var(--slate-500); font-variant-numeric: tabular-nums; font-size: 0.85rem; }
.nkind { font-size: 0.72rem; font-weight: 700; border-radius: 999px; padding: 0.1rem 0.55rem; text-align: center; border: 1px solid transparent; white-space: nowrap; }
.nkind.release { background: var(--st-good-bg); color: var(--st-good-text); border-color: var(--st-good-border); }
.nkind.column { background: var(--st-info-bg); color: var(--st-info-text); border-color: var(--st-info-border); }
.nkind.mention { background: var(--slate-100); color: var(--slate-600); }
.ntitle { color: var(--primary-900); font-weight: 500; }
.noutlet { color: var(--slate-500); font-size: 0.83rem; white-space: nowrap; }
.ntopic { color: var(--accent); font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
@media (max-width: 760px) { .newsitem { grid-template-columns: 1fr; gap: 0.15rem; } .noutlet, .ntopic { display: inline; margin-right: 0.6rem; } }
</style>
<script>
const state = { kind: 'all', topic: 'all' };
const items = Array.from(document.querySelectorAll<HTMLElement>('.newsitem'));
const years = Array.from(document.querySelectorAll<HTMLElement>('.year'));
function apply() {
for (const el of items) {
const ok = (state.kind === 'all' || el.dataset.kind === state.kind) && (state.topic === 'all' || el.dataset.topic === state.topic);
el.classList.toggle('hidden', !ok);
}
for (const y of years) {
const visible = y.querySelectorAll('.newsitem:not(.hidden)').length;
y.classList.toggle('hidden', visible === 0);
const c = y.querySelector('.ycount'); if (c) c.textContent = `${visible}건`;
}
}
document.querySelectorAll<HTMLButtonElement>('.chipbtn').forEach((b) => b.addEventListener('click', () => {
const key = b.dataset.kind ? 'kind' : 'topic'; const val = (b.dataset.kind ?? b.dataset.topic)!;
(state as any)[key] = val;
b.parentElement!.querySelectorAll('.chipbtn').forEach((x) => x.classList.toggle('active', x === b));
apply();
}));
</script>
@@ -0,0 +1,94 @@
---
import { getCollection, render } from 'astro:content';
import Base from '../../layouts/Base.astro';
import Summary from '../../components/Summary.astro';
import VideoLite from '../../components/VideoLite.astro';
import RelatedVideos from '../../components/RelatedVideos.astro';
import Gallery from '../../components/Gallery.astro';
import Faq from '../../components/Faq.astro';
import ReviewBox from '../../components/ReviewBox.astro';
import Sources from '../../components/Sources.astro';
import History from '../../components/History.astro';
import Disclosure from '../../components/Disclosure.astro';
import FactBlock from '../../components/FactBlock.astro';
import { CATEGORY_LABELS, SITE_NAME, clinicSchema, personSchema, physicianSchema, physician, supporter, fact, surface } from '../../lib';
export async function getStaticPaths() {
const posts = await getCollection('posts');
return posts.map((post) => ({ params: { id: post.id }, props: { post } }));
}
const { post } = Astro.props;
const d = post.data;
const { Content } = await render(post);
const site = Astro.site!.toString().replace(/\/$/, '');
const url = `${site}/posts/${post.id}`;
const videos = d.videos.length ? d.videos : d.video ? [d.video] : [];
const [mainVideo, ...moreVideos] = videos;
const reviewer = d.reviewer ? physician(d.reviewer) : null;
const article: Record<string, any> = {
'@type': ['Article', 'MedicalWebPage'],
'@id': `${url}#article`,
headline: d.title,
description: d.description,
inLanguage: 'ko',
url,
mainEntityOfPage: url,
datePublished: d.datePublished,
dateModified: d.dateModified,
author: { '@id': `${site}/authors/${d.author}#person` },
publisher: { '@type': 'Organization', name: SITE_NAME, url: site },
about: { '@id': `${fact.url}/#clinic` },
image: [d.hero?.src, ...d.gallery.map((g) => g.src)].filter(Boolean).map((s) => `${site}${s}`),
};
if (!article.image.length && clinicSchema(site).image) article.image = [clinicSchema(site).image];
if (!article.image.length) delete article.image;
// 감수가 실제로 끝난 글에만 reviewedBy를 넣는다. 감수 예정 상태에서 넣으면 허위 표기다.
if (reviewer && d.reviewStatus === 'reviewed') { article.reviewedBy = { '@id': `${reviewer.url}#physician` }; if (d.reviewedAt) article.lastReviewed = d.reviewedAt; }
if (videos.length) article.video = videos.map((v) => ({ '@type': 'VideoObject', name: v.title, embedUrl: `https://www.youtube-nocookie.com/embed/${v.id}`, url: `https://www.youtube.com/watch?v=${v.id}`, thumbnailUrl: `https://i.ytimg.com/vi/${v.id}/hqdefault.jpg`, uploadDate: v.published ?? d.datePublished, description: v.title, publisher: { '@type': 'Organization', name: `${surface('youtube').title ?? fact.shortName} (YouTube)` } }));
const graph: any[] = [article, personSchema(d.author, site), clinicSchema(site)];
if (d.reviewer) graph.push(physicianSchema(d.reviewer));
if (d.faq.length) graph.push({ '@type': 'FAQPage', '@id': `${url}#faq`, mainEntity: d.faq.map((f) => ({ '@type': 'Question', name: f.q, acceptedAnswer: { '@type': 'Answer', text: f.a } })) });
---
<Base title={d.title} description={d.description} jsonLd={graph} type="article" ogImage={d.hero?.src}>
<article class="wrap" style="padding-bottom:4rem" data-qb={d.qbIds.join(',')}>
<header class="article-head">
<div class="eyebrow">{d.category} · {CATEGORY_LABELS[d.category]}</div>
<h1>{d.title}</h1>
<div class="meta">
<span>작성 {supporter(d.author).name}</span>
{reviewer && <span>{d.reviewStatus === 'reviewed' ? '의학 검토' : '설명'} {reviewer.name} {reviewer.title.split(' · ')[0]}{d.reviewStatus === 'reviewed' && d.reviewedAt ? ` (${d.reviewedAt})` : ''}</span>}
{d.reviewStatus !== 'reviewed' && <span>의학 검토 대기</span>}
<span>발행 {d.datePublished}</span>
<span>갱신 {d.dateModified}</span>
</div>
</header>
<Summary items={d.summary} />
{d.hero && (
<figure class="figure">
<img src={d.hero.src} alt={d.hero.alt} loading="eager" />
<figcaption>{d.hero.caption}</figcaption>
</figure>
)}
{mainVideo && <VideoLite {...mainVideo} />}
{reviewer && (
<div class="doctor-strip">
{reviewer.image && <img src={reviewer.image} alt={`${reviewer.name} ${reviewer.title}`} />}
<div>
<div class="name">{reviewer.name} <span style="font-weight:500;color:var(--slate-600)">{reviewer.title}</span></div>
<p class="creds">{reviewer.credentials.slice(0, 3).join(' · ')} <a href={reviewer.url} rel="noopener">프로필</a></p>
</div>
</div>
)}
<Content />
<Gallery items={d.gallery} />
<RelatedVideos items={moreVideos} title="이어서 볼 원장 영상" />
<Faq items={d.faq} />
<ReviewBox author={d.author} reviewer={d.reviewer} status={d.reviewStatus} dateModified={d.reviewedAt ?? d.dateModified} />
<Sources items={d.sources} />
<History items={d.history} />
<FactBlock compact />
<Disclosure />
</article>
</Base>
@@ -0,0 +1,41 @@
---
import { getCollection } from 'astro:content';
import Base from '../../layouts/Base.astro';
import PostCard from '../../components/PostCard.astro';
import { CATEGORY_LABELS, SITE_NAME, fact, v } from '../../lib';
const posts = (await getCollection('posts')).sort((a, b) => b.data.dateModified.localeCompare(a.data.dateModified));
const cats = Object.keys(CATEGORY_LABELS);
const site = Astro.site!.toString().replace(/\/$/, '');
const ld = { '@type': 'CollectionPage', '@id': `${site}/posts#page`, name: '전체 글', url: `${site}/posts`, inLanguage: 'ko', publisher: { '@type': 'Organization', name: SITE_NAME, url: site }, hasPart: posts.map((p) => ({ '@type': 'Article', headline: p.data.title, url: `${site}/posts/${p.id}`, dateModified: p.data.dateModified })) };
---
<Base title="전체 글" description={`${v(fact.shortName, '병원')}에 대해 자주 묻는 질문과 답을 주제별로 모았습니다.`} jsonLd={ld}>
<div class="wrap-wide" style="padding-bottom:4rem">
<header class="article-head"><div class="eyebrow">Archive</div><h1 class="serif">All Answers</h1><p style="color:var(--slate-600);margin-top:0.6rem">궁금한 주제를 골라 보세요. 글 하나가 질문 하나에 답합니다.</p></header>
{!posts.length && <p class="sub" style="color:var(--slate-500);margin-top:1.5rem">아직 발행한 글이 없습니다. 검토를 마친 글부터 차례로 올립니다.</p>}
<div class="cat-grid">
{cats.map((c) => {
const list = posts.filter((p) => p.data.category === c);
if (!list.length) return null;
return (<section id={`cat-${c}`} class={`cat span-${Math.min(list.length, 3)}`}><div class="section-title"><h2>{c}. {CATEGORY_LABELS[c]}</h2><span style="color:var(--slate-500);font-size:0.9rem">{list.length}편</span></div><div class="grid">{list.map((p) => <PostCard post={p} />)}</div></section>);
})}
</div>
</div>
</Base>
<style>
/* 카테고리 블록이 글 수만큼만 칸을 차지한다. 데스크톱 3열 → 태블릿 2열 → 모바일 1열 */
.cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.4rem 1.25rem; margin-top: 2.4rem; align-items: start; }
.cat { scroll-margin-top: 90px; min-width: 0; }
.cat .section-title { margin-bottom: 1rem; }
.cat .grid { grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); }
.span-1 { grid-column: span 1; --cols: 1; }
.span-2 { grid-column: span 2; --cols: 2; }
.span-3 { grid-column: span 3; --cols: 3; }
@media (max-width: 1000px) {
.cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-3 { grid-column: span 2; --cols: 2; }
}
@media (max-width: 660px) {
.cat-grid { grid-template-columns: 1fr; gap: 2rem; }
.span-2, .span-3 { grid-column: span 1; --cols: 1; }
}
</style>
@@ -0,0 +1,10 @@
import type { APIRoute } from 'astro';
// 샘플: 전면 차단. 프로덕션(PUBLIC_INDEXABLE=true): 전면 허용 + AI 크롤러 명시 허용.
const AI_BOTS = ['GPTBot', 'OAI-SearchBot', 'ChatGPT-User', 'PerplexityBot', 'ClaudeBot', 'Claude-SearchBot', 'Google-Extended', 'Applebot-Extended', 'Bingbot', 'Yeti', 'Googlebot'];
export const GET: APIRoute = ({ site }) => {
const indexable = import.meta.env.PUBLIC_INDEXABLE === 'true';
const body = indexable
? [...AI_BOTS.map((b) => `User-agent: ${b}\nAllow: /`), 'User-agent: *\nAllow: /', `Sitemap: ${site}sitemap.xml`].join('\n\n') + '\n'
: `# 샘플 사이트. 색인 금지.\nUser-agent: *\nDisallow: /\n`;
return new Response(body, { headers: { 'Content-Type': 'text/plain; charset=utf-8' } });
};
@@ -0,0 +1,22 @@
import type { APIRoute } from 'astro';
import { getCollection } from 'astro:content';
import authors from '../data/authors.json';
export const GET: APIRoute = async ({ site }) => {
const base = site!.toString().replace(/\/$/, '');
const posts = await getCollection('posts');
const today = new Date().toISOString().slice(0, 10);
const urls = [
{ loc: `${base}/`, lastmod: today },
{ loc: `${base}/posts`, lastmod: today },
{ loc: `${base}/clinic`, lastmod: today },
{ loc: `${base}/visit`, lastmod: today },
{ loc: `${base}/newsroom`, lastmod: today },
{ loc: `${base}/videos`, lastmod: today },
{ loc: `${base}/about`, lastmod: today },
{ loc: `${base}/corrections`, lastmod: today },
...Object.keys(authors.supporters).map((id) => ({ loc: `${base}/authors/${id}`, lastmod: today })),
...posts.map((p) => ({ loc: `${base}/posts/${p.id}`, lastmod: p.data.dateModified })),
];
const xml = `<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n${urls.map((u) => ` <url><loc>${u.loc}</loc><lastmod>${u.lastmod}</lastmod></url>`).join('\n')}\n</urlset>\n`;
return new Response(xml, { headers: { 'Content-Type': 'application/xml; charset=utf-8' } });
};
@@ -0,0 +1,109 @@
---
import Base from '../layouts/Base.astro';
import VideoLite from '../components/VideoLite.astro';
import data from '../data/videos.json';
import { SITE_NAME, fact, surface, v, has, PENDING } from '../lib';
const clinic = v(fact.shortName, '병원');
const gu = surface('gangnamunni');
type V = { id: string; title: string; published: string; views: number; likes: number | null; comments: number | null; duration: number };
const site = Astro.site!.toString().replace(/\/$/, '');
const ch = (data.channel ?? {}) as Record<string, any>;
const topLong = (data.topLong ?? []) as V[]; const topAll = (data.top ?? []) as V[];
const fetchedAt = data.fetchedAt ?? PENDING;
const fmt = (n: number) => n >= 10000 ? `${(n / 10000).toFixed(n >= 100000 ? 0 : 1)}만` : n.toLocaleString();
const dur = (s: number) => s >= 3600 ? `${Math.floor(s / 3600)}:${String(Math.floor((s % 3600) / 60)).padStart(2, '0')}:${String(s % 60).padStart(2, '0')}` : `${Math.floor(s / 60)}:${String(s % 60).padStart(2, '0')}`;
const shorts = (data.shortsInfo ?? []) as (V & { answer: string; qb?: string })[];
const tabs: { key: string; label: string; desc: string; list: V[] }[] = [
{ key: 'long', label: '설명 영상 Top 10', desc: '수술 방법과 안전을 차분히 설명하는 영상입니다. 후기나 토크 영상은 넣지 않았습니다', list: topLong },
{ key: 'shorts', label: '1분 답변 영상', desc: '궁금한 것 하나에 1분 안에 답하는 짧은 영상입니다. 영상마다 서포터즈가 답을 한 문단으로 정리해 두었습니다', list: shorts },
{ key: 'all', label: '채널 인기 전체', desc: '주제와 길이를 가리지 않고 채널에서 가장 많이 본 영상입니다', list: topAll },
];
const ld = [
{ '@type': 'CollectionPage', '@id': `${site}/videos#page`, name: `${clinic} 유튜브 조회수 Top 10`, url: `${site}/videos`, inLanguage: 'ko', about: { '@id': `${fact.url}/#clinic` }, publisher: { '@type': 'Organization', name: SITE_NAME, url: site }, ...(data.fetchedAt ? { dateModified: data.fetchedAt } : {}) },
{ '@type': 'ItemList', '@id': `${site}/videos#list`, name: `${clinic} 유튜브 조회수 상위 영상`, itemListOrder: 'https://schema.org/ItemListOrderDescending', numberOfItems: topAll.length, itemListElement: topAll.map((v, i) => ({ '@type': 'ListItem', position: i + 1, item: { '@type': 'VideoObject', name: v.title, url: `https://www.youtube.com/watch?v=${v.id}`, embedUrl: `https://www.youtube-nocookie.com/embed/${v.id}`, thumbnailUrl: `https://i.ytimg.com/vi/${v.id}/hqdefault.jpg`, uploadDate: v.published, duration: `PT${v.duration}S`, interactionStatistic: { '@type': 'InteractionCounter', interactionType: 'https://schema.org/WatchAction', userInteractionCount: v.views }, publisher: { '@type': 'Organization', name: ch.title, url: ch.url } } })) },
];
---
<Base title={`의료진 영상 · ${clinic} 원장이 직접 설명하는 영상`} description={`${clinic} 원장이 수술 방법과 안전을 직접 설명하는 공식 유튜브 영상을 골라 모았습니다. 궁금한 영상을 바로 재생할 수 있고, 짧은 영상에는 서포터즈가 답을 글로 정리했습니다. 조회수는 ${fetchedAt} 기준.`} jsonLd={ld}>
<section class="section dark" style="padding:3.5rem 0 3rem">
<div class="wrap-wide">
<div class="sec-head"><div class="eyebrow" style="color:var(--purple-300)">Videos</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">Most Watched</h1><p class="sub">원장이 수술 방법과 안전을 직접 설명하는 영상을 골라 모았습니다. 궁금한 영상을 여기서 바로 재생할 수 있습니다.</p>
<div class="doc-links">
<a class="doc-link" href={(fact as any).doctorsUrl || fact.url} rel="noopener" target="_blank">
<span class="ico" aria-hidden="true"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M12 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10Zm0 2c-4.4 0-8 2.2-8 5v3h16v-3c0-2.8-3.6-5-8-5Z"/></svg></span>
<span class="txt"><b>의료진 소개</b><small>{clinic} 공식 홈페이지</small></span>
<span class="arrow" aria-hidden="true"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M14 4h6v6h-2V7.4l-8.3 8.3-1.4-1.4L16.6 6H14V4ZM4 6h6v2H6v10h10v-4h2v6H4V6Z"/></svg></span>
</a>
<a class="doc-link" href={gu.url || fact.url} rel="noopener" target="_blank">
<span class="ico" aria-hidden="true"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2 3 6v6c0 5.3 3.8 10.2 9 11.5C17.2 22.2 21 17.3 21 12V6l-9-4Zm-1 14-3.5-3.5 1.4-1.4L11 13.2l5.1-5.1 1.4 1.4L11 16Z"/></svg></span>
<span class="txt"><b>의료진 {v(gu.doctors)}명</b><small>강남언니 등록 의료진</small></span>
<span class="arrow" aria-hidden="true"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M14 4h6v6h-2V7.4l-8.3 8.3-1.4-1.4L16.6 6H14V4ZM4 6h6v2H6v10h10v-4h2v6H4V6Z"/></svg></span>
</a>
</div></div>
<div class="stats">
<div class="stat"><b>{has(ch.totalViews) ? fmt(ch.totalViews) : PENDING}</b><span class="label">누적 조회수</span><span class="desc">공식 유튜브 채널 영상 {has(ch.videos) ? ch.videos.toLocaleString() : PENDING}편 합계 ({fetchedAt} 기준)</span></div>
<div class="stat"><b>{v(ch.subscribers)}</b><span class="label">구독자</span><span class="desc">{has(ch.url) ? <a href={ch.url} rel="noopener" style="color:var(--purple-300)">{ch.handle}</a> : PENDING}</span></div>
<div class="stat"><b>{topLong[0] ? fmt(topLong[0].views) : PENDING}</b><span class="label">설명 영상 1위 조회수</span><span class="desc">{topLong[0]?.title ?? '채널 영상 집계 뒤 표시'}</span></div>
<div class="stat"><b>{shorts.length}</b><span class="label">정보형 쇼츠</span><span class="desc">궁금한 것 하나에 1분 안에 답하는 영상. 서포터즈가 답을 글로도 정리했습니다.</span></div>
</div>
</div>
</section>
<section class="section light" style="padding-top:2.2rem">
<div class="wrap-wide">
<div class="vtabs" role="tablist">
{tabs.map((t, i) => <button class={`chipbtn ${i === 0 ? 'active' : ''}`} role="tab" data-tab={t.key} aria-selected={i === 0}>{t.label}</button>)}
</div>
{tabs.map((t, i) => (
<div class="vpanel" data-panel={t.key} hidden={i !== 0}>
<p class="sub" style="color:var(--slate-600);margin:0.8rem 0 1.2rem">{t.desc}. 조회수는 {fetchedAt} 기준입니다.</p>
{!t.list.length && <p class="sub" style="color:var(--slate-500)">채널 영상을 집계한 뒤 싣습니다. {PENDING}.</p>}
<ol class="vlist">
{t.list.map((v, idx) => (
<li class="vitem">
<div class="vrank serif">{idx + 1}</div>
<div class="vmedia"><VideoLite id={v.id} title={v.title} published={v.published} compact /></div>
<div class="vmeta">
<div class="vstats"><b>{fmt(v.views)}회</b> 조회{v.likes != null && <> · 좋아요 {fmt(v.likes)}</>}{v.comments != null && <> · 댓글 {v.comments.toLocaleString()}</>}</div>
<div class="vsub">{(v as any).isShort && <span class="nkind" style="background:var(--slate-100);color:var(--slate-600);font-size:0.7rem;font-weight:700;border-radius:999px;padding:0.05rem 0.5rem;margin-right:0.4rem">쇼츠</span>}{dur(v.duration)} · {v.published} 게시 · <a href={`https://www.youtube.com/watch?v=${v.id}`} rel="noopener" target="_blank">유튜브에서 보기</a></div>
{(v as any).answer && <div class="vanswer"><span class="vq">서포터즈 답</span><p>{(v as any).answer}</p></div>}
</div>
</li>
))}
</ol>
</div>
))}
<p class="disclosure">영상은 {clinic} 공식 유튜브 채널에서 재생됩니다. 조회수·좋아요·댓글 수는 {fetchedAt} 기준입니다.</p>
</div>
</section>
</Base>
<style>
.doc-links { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.3rem; }
.doc-link { display: inline-flex; align-items: center; gap: 0.7rem; padding: 0.6rem 1rem 0.6rem 0.75rem; border-radius: 999px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16); color: #fff; text-decoration: none; transition: background .2s, border-color .2s, transform .2s; }
.doc-link:hover { background: rgba(255,255,255,0.14); border-color: rgba(216,180,254,0.6); text-decoration: none; transform: translateY(-1px); }
.doc-link .ico { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 999px; background: linear-gradient(to right, var(--grad-start), #6C5CE7); color: #fff; flex: none; }
.doc-link .txt { display: flex; flex-direction: column; line-height: 1.2; }
.doc-link .txt b { font-size: 0.92rem; font-weight: 700; }
.doc-link .txt small { font-size: 0.74rem; color: var(--purple-200); margin-top: 0.15rem; }
.doc-link .arrow { color: var(--purple-300); display: inline-flex; margin-left: 0.2rem; }
.vtabs { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chipbtn { border: 1px solid var(--slate-200); background: #fff; color: var(--slate-600); border-radius: 999px; padding: 0.4rem 1rem; font-size: 0.88rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.chipbtn.active { background: linear-gradient(to right, var(--grad-start), var(--grad-end)); color: #fff; border-color: transparent; }
.vlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; }
.vitem { display: grid; grid-template-columns: 3.2rem 360px 1fr; gap: 1.1rem; align-items: start; background: #fff; border: 1px solid var(--slate-100); border-radius: 16px; padding: 1rem 1.2rem; box-shadow: var(--shadow); }
.vrank { font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1; padding-top: 0.2rem; }
.vmeta { padding-top: 0.2rem; }
.vstats { font-size: 1rem; color: var(--primary-900); }
.vstats b { font-size: 1.25rem; font-family: "Playfair Display", Georgia, serif; }
.vsub { color: var(--slate-500); font-size: 0.86rem; margin-top: 0.3rem; }
.vanswer { margin-top: 0.8rem; background: #F2F6FF; border: 1px solid #E3EAFB; border-radius: 12px; padding: 0.8rem 1rem; }
.vanswer .vq { font-size: 0.72rem; font-weight: 700; color: var(--grad-start); letter-spacing: 0.06em; }
.vanswer p { margin: 0.25rem 0 0; font-size: 0.93rem; color: var(--primary-900); }
.vanswer .vqb { display: inline-block; margin-top: 0.4rem; font-size: 0.72rem; color: var(--accent); font-weight: 600; }
.vmedia .yt figcaption span { display: none; }
@media (max-width: 860px) { .vitem { grid-template-columns: 2.4rem 1fr; } .vmeta { grid-column: 2; } }
</style>
<script>
document.querySelectorAll<HTMLButtonElement>('.vtabs .chipbtn').forEach((b) => b.addEventListener('click', () => {
document.querySelectorAll('.vtabs .chipbtn').forEach((x) => { x.classList.toggle('active', x === b); x.setAttribute('aria-selected', String(x === b)); });
document.querySelectorAll<HTMLElement>('.vpanel').forEach((p) => { p.hidden = p.dataset.panel !== b.dataset.tab; });
}));
</script>
@@ -0,0 +1,47 @@
---
// 방문 안내. 병원 정보(/clinic)가 사실 표라면 이 페이지는 "예약하고, 찾아가고, 도착해서 뭘 하는지"의 행동 순서다. 값은 모두 factSheet.json에서 가져온다.
import Base from '../layouts/Base.astro';
import Gallery from '../components/Gallery.astro';
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, '병원');
const site = Astro.site!.toString().replace(/\/$/, '');
const ld = [
{ '@type': 'WebPage', '@id': `${site}/visit#page`, name: `${clinic} 방문 안내`, url: `${site}/visit`, inLanguage: 'ko', isPartOf: { '@id': `${site}/#website` }, about: { '@id': `${fact.url}/#clinic` }, publisher: { '@type': 'Organization', name: SITE_NAME, url: site } },
clinicSchema(site),
];
---
<Base title="방문 안내 · 예약, 가는 길, 주차, 도착 후 동선" description={`${clinic} 방문 준비. 예약 경로, 가는 길, 주차장 진입 경로, 진료시간, 도착 후 동선을 순서대로 안내합니다. 주소 ${v(f.address?.full)}.`} jsonLd={ld}>
<article class="wrap" style="padding-bottom:4rem">
<header class="article-head"><div class="eyebrow">Visit</div><h1 class="serif">Plan Your Visit</h1><p style="color:var(--slate-600);margin-top:0.6rem"><strong style="color:var(--primary-900)">{clinic} 방문 안내.</strong> 예약부터 도착 후 동선까지 순서대로 정리했습니다. 주소·전화·진료시간의 근거는 <a href="/clinic">병원 정보</a>에 있습니다.</p></header>
<h2>1. 예약하기</h2>
<p>상담 예약 경로는 세 가지입니다. 어느 쪽이든 같은 병원 상담센터로 연결됩니다.</p>
<div class="table-wrap"><table><thead><tr><th>경로</th><th>방법</th></tr></thead><tbody>
<tr><td>전화</td><td>{has(f.phone) ? <a href={`tel:${f.phone.replace(/-/g, '')}`}>{f.phone}</a> : v(null)}</td></tr>
<tr><td>카카오톡 채널</td><td>{has(f.kakao) ? <a href={f.kakao} rel="noopener">{clinic} 상담 채널</a> : v(null)}</td></tr>
<tr><td>홈페이지</td><td>{has(reservationUrl) ? <a href={reservationUrl} rel="noopener">온라인 예약 페이지</a> : v(null)}</td></tr>
</tbody></table></div>
<h2>2. 진료시간 확인하기</h2>
<div class="table-wrap"><table><thead><tr><th>요일</th><th>진료</th></tr></thead><tbody>{(f.hours?.rows ?? []).map((r: any) => <tr><td>{r.days}</td><td>{r.open ? `${r.open} ~ ${r.close}` : r.note}</td></tr>)}{!(f.hours?.rows ?? []).length && <tr><td colspan="2">{v(null)}</td></tr>}</tbody></table></div>
<p style="font-size:0.88rem;color:var(--slate-500)">출처: {has(f.hours?.source) ? <a href={f.hours.source} rel="noopener">{f.hours.sourceLabel}</a> : v(null)}. 진료시간은 바뀔 수 있으니 방문 전 전화로 한 번 더 확인하세요.</p>
<h2>3. 찾아가기</h2>
<p><strong>주소</strong> {v(f.address?.full)}{has(f.address?.postalNote) && <> (지번 {f.address.postalNote})</>}</p>
<p><strong>지하철</strong> {v(f.transit)}.{has(f.transitNote) && <> {f.transitNote}</>}</p>
<p><strong>차로 올 때</strong> {v(f.parking, `주차 안내 ${v(null)}`)}.</p>
{S.visitMaps?.length > 0 && <Gallery cols={2} items={S.visitMaps} />}
<h2>4. 도착하면</h2>
<p>{v(S.arrivalGuide, `도착 후 동선은 병원 확인 뒤 싣습니다. ${v(null)}.`)} 층별 구성 전체는 <a href="/clinic">병원 정보</a>에 있습니다.</p>
<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>
<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>
</Base>