merge: feature/supporters-autobuild + feature/ai-sentiment-rubric 를 Product 1.0 한 줄기로 합침
Product 1.0 범위는 진단 + 서포터즈 초안(haewon 결정). 브랜치 확인 결과 핸드오버 §1 의 미확인 항목 두 건은 이미 해결 상태였다. 리드 CTA(DiscoveryLeadModal·discovery_leads 마이그레이션)와 AEO/GEO v2 기준표는 셋 다 main 에 있고 blob 이 동일하다. feature/discovery-url-cta 는 main 대비 ahead 0 / behind 22 인 낡은 포인터라 머지 대상에서 뺐다. supporters/ 정본은 메인 쪽(뷰 수작업 샘플)으로 정했다(haewon 결정). 겹친 22개 파일 중 실제로 다른 것은 9개였고 전부 메인 쪽을 취했다. layout-baseline.json 은 Base.astro 가 내는 언어 전환 링크 모양(a.lang-switch)과 짝이라 같은 쪽으로 가져왔다. Productize 쪽에만 있던 두 가지를 정본으로 옮겼다. - GA4 태그: site.json 의 ga4MeasurementId 가 G-형식일 때만 삽입한다. 값이 없으면 스크립트가 아예 나가지 않는다. 키 이벤트 이름은 data/ai_channels.json 의 conversion_events 와 맞춘다. - 영문 법적 고지: 지원 관계·부작용 고지는 의료법 56조 대상이라 임의 번역하지 않는다. i18n.ts 에 병원 승인 없는 영문 번역이 들어 있어 푸터에서 쓰지 않도록 했다. site.json 의 sponsorNoticeEn · factSheet 의 sideEffectNoticeEn 이 채워지기 전까지 영문 화면은 한국어 원문과 확인 대기 표기를 함께 낸다. 검증: astro build 32페이지, 게이트 41/41 통과, check.mjs 오류 0건 (경고 23건은 기존 건으로 site.sponsorNotice 미설정 18건과 원고 수치 한정 5건), 루트 tsc --noEmit 0 에러. GA4 는 임시 측정 ID 로 삽입·미삽입 양쪽을 확인하고 원복했다. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
commit
f01bc6cafc
40 files changed
+5411
-302
No files matched your search
@@ -1,6 +1,8 @@
|
||||
---
|
||||
import '../styles/global.css';
|
||||
import { SITE_NAME, SITE_TAGLINE, INDEXABLE, fact, site as S, surface, reservationUrl, editor, has, v } from '../lib';
|
||||
import { UI, switchHref } from '../lib/i18n';
|
||||
import EN from '../data/factSheetEn.json';
|
||||
const ed = editor();
|
||||
const f = fact as Record<string, any>;
|
||||
|
||||
@@ -11,41 +13,28 @@ interface Props {
|
||||
ogImage?: string;
|
||||
type?: 'website' | 'article';
|
||||
noindex?: boolean;
|
||||
/** 페이지 언어. 외국인 환자용 영문 페이지(/en/*)에서 'en' 을 넘긴다. 기본은 한국어다. */
|
||||
lang?: 'ko' | 'en';
|
||||
alternates?: { lang: string; href: string }[];
|
||||
}
|
||||
const { title, description, jsonLd, ogImage = S.buildingImage?.src || '/favicon.svg', type = 'website', noindex = false, lang = 'ko' } = Astro.props;
|
||||
const isEn = lang === 'en';
|
||||
// 머리말·꼬리말 문구. 법적 고지(지원 관계·부작용)는 번역하지 않는다. 아래 주석 참조.
|
||||
const T = isEn
|
||||
? { nav: [['/posts', 'Questions'], ['/videos', 'Doctors'], ['/newsroom', 'Newsroom'], ['/en/plan', 'Recovery Planner'], ['/about', 'About']], cta: 'Book a Consultation', supporters: 'SUPPORTERS', back: 'Back', top: 'Back to top', sample: 'This is a sample site, not yet public.' }
|
||||
: { nav: [['/posts', '상담 전 질문'], ['/videos', '의료진 영상'], ['/newsroom', '뉴스룸'], ['/visit', '방문 안내'], ['/plan', '회복 일정'], ['/about', '매체 소개']], cta: '상담 예약', supporters: '서포터즈', back: '이전 페이지', top: '맨 위로', sample: '샘플 사이트입니다. 정식 공개 전입니다.' };
|
||||
|
||||
// 언어 전환. 같은 내용의 짝이 있는 페이지만 서로 잇고, 없으면 그 언어의 입구로 보낸다.
|
||||
// 영문 페이지가 늘어나면 이 표에 줄만 추가한다.
|
||||
const PAIRS: Record<string, string> = { '/plan': '/en/plan', '/visit': '/en/plan' };
|
||||
const KO_ENTRY = '/';
|
||||
const EN_ENTRY = '/en/plan';
|
||||
const path = (Astro.url.pathname.replace(/\.html$/, '').replace(/\/index$/, '/').replace(/\/$/, '') || '/');
|
||||
const koPair = Object.entries(PAIRS).find(([, en]) => en === path)?.[0];
|
||||
const otherHref = isEn ? (koPair ?? KO_ENTRY) : (PAIRS[path] ?? EN_ENTRY);
|
||||
// 짝이 없으면 같은 글의 번역본으로 가는 것이 아니므로 그렇게 말한다.
|
||||
const otherExact = isEn ? Boolean(koPair) : Boolean(PAIRS[path]);
|
||||
// 영문 페이지의 예약 버튼은 병원의 외국인용 영문 사이트로 보낸다(factSheet.urlEn).
|
||||
// 한국어 예약 페이지로 보내면 영어로 온 사람이 한국어 화면을 만난다.
|
||||
const ctaHref = isEn
|
||||
? ((f as Record<string, any>).reservationUrlEn || (f as Record<string, any>).urlEn || reservationUrl || '/en/plan')
|
||||
: (reservationUrl || '/visit');
|
||||
// 의료광고 고지는 규정 대상이라 임의로 번역하지 않는다(의료법 56조·추천보증 심사지침).
|
||||
// 병원이 영문 문구를 확정해 site.json 의 sponsorNoticeEn / factSheet 의 sideEffectNoticeEn 에 넣기 전까지는
|
||||
// 한국어 원문을 그대로 싣고 확인 대기임을 밝힌다.
|
||||
const sponsorEn: string = (S as Record<string, any>).sponsorNoticeEn || '';
|
||||
const sideEffectEn: string = (f as Record<string, any>).sideEffectNoticeEn || '';
|
||||
const { title, description, jsonLd, ogImage = S.buildingImage?.src || '/favicon.svg', type = 'website', noindex = false, lang = 'ko', alternates = [] } = Astro.props;
|
||||
const site = Astro.site?.toString().replace(/\/$/, '') ?? '';
|
||||
const cleanPath = Astro.url.pathname.replace(/\/index\.html$/, '/').replace(/\.html$/, '');
|
||||
const canonical = (new URL(cleanPath, Astro.site).toString().replace(/\/$/, '') || site);
|
||||
const u = UI[lang];
|
||||
const other = lang === 'ko' ? 'en' : 'ko';
|
||||
const switchTo = switchHref(Astro.url.pathname, other);
|
||||
const homeHref = lang === 'en' ? '/en' : '/';
|
||||
const isHome = ['/', '', '/index.html', '/index', '/en', '/en/index.html', '/en/index'].includes(Astro.url.pathname.replace(/\/$/, '') || '/');
|
||||
// GA4: site.json 의 ga4MeasurementId(G-XXXX) 가 있을 때만 태그를 넣는다. 키 이벤트는 data/ai_channels.json conversion_events 와 같은 이름(click_tel · click_reservation · click_clinic_site · click_map).
|
||||
const GA4: string = /^G-[A-Z0-9]{6,}$/.test(String((S as Record<string, any>).ga4MeasurementId ?? '')) ? String((S as Record<string, any>).ga4MeasurementId) : '';
|
||||
// 의료광고 고지는 규정 대상이라 임의로 번역하지 않는다(의료법 56조·추천보증 심사지침).
|
||||
// 병원이 영문 문구를 확정해 site.json 의 sponsorNoticeEn / factSheet 의 sideEffectNoticeEn 에 넣기 전까지는
|
||||
// 한국어 원문을 그대로 싣고 확인 대기임을 밝힌다. i18n.ts 의 영문 foot_sponsor·foot_side 는 이 자리에 쓰지 않는다.
|
||||
const sponsorEn: string = (S as Record<string, any>).sponsorNoticeEn || '';
|
||||
const sideEffectEn: string = (f as Record<string, any>).sideEffectNoticeEn || '';
|
||||
const noticePending = lang === 'en' && !sponsorEn;
|
||||
const sponsorText = (lang === 'en' && sponsorEn) ? sponsorEn : UI.ko.foot_sponsor.replace(/\{clinic\}/g, v(f.shortName, '병원')).replace('{editor}', ed.name);
|
||||
const sideEffectText = (lang === 'en' && sideEffectEn) ? sideEffectEn : fact.sideEffectNotice;
|
||||
const ld = jsonLd ? JSON.stringify({ '@context': 'https://schema.org', ...(Array.isArray(jsonLd) ? { '@graph': jsonLd } : jsonLd) }) : null;
|
||||
---
|
||||
<!doctype html>
|
||||
@@ -63,7 +52,8 @@ const ld = jsonLd ? JSON.stringify({ '@context': 'https://schema.org', ...(Array
|
||||
<meta property="og:description" content={description} />
|
||||
<meta property="og:url" content={canonical} />
|
||||
<meta property="og:image" content={new URL(ogImage, Astro.site).toString()} />
|
||||
<meta property="og:locale" content={isEn ? "en_US" : "ko_KR"} />
|
||||
<meta property="og:locale" content={lang === 'en' ? 'en_US' : 'ko_KR'} />
|
||||
{alternates.map((a) => <link rel="alternate" hreflang={a.lang} href={`${site}${a.href}`} />)}
|
||||
<link rel="stylesheet" as="style" crossorigin href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css" />
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
@@ -74,32 +64,44 @@ const ld = jsonLd ? JSON.stringify({ '@context': 'https://schema.org', ...(Array
|
||||
document.addEventListener('click',function(e){var a=e.target.closest&&e.target.closest('a');if(!a)return;var h=a.getAttribute('href')||'';var ev=h.indexOf('tel:')===0?'click_tel':a.dataset.ga==='reservation'||a.classList.contains('cta')?'click_reservation':a.dataset.ga==='clinic-site'?'click_clinic_site':a.dataset.ga==='map'?'click_map':null;if(ev)gtag('event',ev,{link_url:h,page_path:location.pathname});},true);`} />}
|
||||
</head>
|
||||
<body>
|
||||
{!INDEXABLE && <div class="sample-banner">{T.sample}</div>}
|
||||
{!INDEXABLE && <div class="sample-banner">{u.sample}</div>}
|
||||
<header class="site-header">
|
||||
<div class="wrap-wide bar">
|
||||
<a class="brand" href="/">{has(S.logo?.src) ? <img class="brand-logo" src={S.logo.src} alt={S.logo.alt} width={S.logo.width} height={S.logo.height} /> : <span class="brand-logo brand-name">{v(f.shortName, '병원')}</span>}<span class="brand-sep" aria-hidden="true"></span><span class="brand-text">{T.supporters} <small>{S.siteNameEn || 'SUPPORTERS'}</small></span></a>
|
||||
<a class="brand" href={homeHref}>{has(S.logo?.src) ? <img class="brand-logo" src={S.logo.src} alt={S.logo.alt} width={S.logo.width} height={S.logo.height} /> : <span class="brand-logo brand-name">{v(f.shortName, '병원')}</span>}<span class="brand-sep" aria-hidden="true"></span><span class="brand-text">{u.brand} <small>{S.siteNameEn || 'SUPPORTERS'}</small></span></a>
|
||||
<div class="right">
|
||||
<nav class="nav">
|
||||
{T.nav.map(([href, label]) => <a href={href}>{label}</a>)}
|
||||
{lang === 'ko' ? (
|
||||
<>
|
||||
<a href="/posts">{u.nav_posts}</a>
|
||||
<a href="/videos">{u.nav_videos}</a>
|
||||
<a href="/newsroom">{u.nav_news}</a>
|
||||
<a href="/visit">{u.nav_visit}</a>
|
||||
<a href="/plan">{u.nav_plan}</a>
|
||||
<a href="/about">{u.nav_about}</a>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<a href="/en">{u.nav_home}</a>
|
||||
<a href="/en/plan">{u.nav_plan}</a>
|
||||
<a href="/en#visit">{u.nav_visit}</a>
|
||||
<a href="/en#clinic">{u.nav_clinic}</a>
|
||||
</>
|
||||
)}
|
||||
</nav>
|
||||
<div class="langswitch" role="group" aria-label={isEn ? 'Language' : '언어'}>
|
||||
<a href={isEn ? otherHref : path} hreflang="ko" aria-current={!isEn ? 'true' : undefined} class={!isEn ? 'on' : ''}>KO</a>
|
||||
<a href={isEn ? path : otherHref} hreflang="en" aria-current={isEn ? 'true' : undefined} class={isEn ? 'on' : ''}
|
||||
title={isEn || otherExact ? undefined : 'English pages are limited. This goes to the English section.'}>EN</a>
|
||||
</div>
|
||||
<a class="cta" href={ctaHref} rel="noopener">{T.cta}</a>
|
||||
<a class="lang-switch" href={switchTo} aria-label={u.switchAria} hreflang={other} lang={other}>{u.switchLabel}</a>
|
||||
<a class="cta" href={reservationUrl || '/visit'} rel="noopener">{u.cta}</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
{!['/', '', '/index.html', '/index'].includes(Astro.url.pathname.replace(/\/$/, '') || '/') && (
|
||||
{!isHome && (
|
||||
<div class="backbar-wrap"><div class="wrap-wide backbar">
|
||||
<a href="/" class="backbtn" id="backbtn" aria-label={T.back}><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M15.5 4.5 8 12l7.5 7.5 1.8-1.8L11.6 12l5.7-5.7z"/></svg>{T.back}</a>
|
||||
<a href={homeHref} class="backbtn" id="backbtn" aria-label={u.backAria}><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M15.5 4.5 8 12l7.5 7.5 1.8-1.8L11.6 12l5.7-5.7z"/></svg>{u.back}</a>
|
||||
</div></div>
|
||||
)}
|
||||
<main>
|
||||
<slot />
|
||||
</main>
|
||||
<button type="button" class="totop" id="totop" aria-label={T.top}><svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 5 4.5 12.5l1.8 1.8L11 9.6V20h2V9.6l4.7 4.7 1.8-1.8z"/></svg></button>
|
||||
<button type="button" class="totop" id="totop" aria-label={u.totop}><svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 5 4.5 12.5l1.8 1.8L11 9.6V20h2V9.6l4.7 4.7 1.8-1.8z"/></svg></button>
|
||||
<script>
|
||||
const back = document.getElementById('backbtn');
|
||||
if (back) back.addEventListener('click', (e) => { if (history.length > 1 && document.referrer && new URL(document.referrer).origin === location.origin) { e.preventDefault(); history.back(); } });
|
||||
@@ -112,16 +114,20 @@ document.addEventListener('click',function(e){var a=e.target.closest&&e.target.c
|
||||
<div class="wrap-wide cols">
|
||||
<div>
|
||||
<p><strong>{SITE_NAME}</strong> · {SITE_TAGLINE}</p>
|
||||
{isEn && !sponsorEn && <p class="notice-pending">Korean original below. The English wording of these notices is pending clinic approval.</p>}
|
||||
<p>{isEn && sponsorEn ? sponsorEn : <>이 매체는 {v(f.shortName, '병원')}의 지원을 받아 서포터즈가 운영합니다. 글의 의학적 내용은 {v(f.shortName, '병원')} 담당 원장의 검토를 거쳐 표시하며, 검토 전 글은 "의학 검토 대기"로 표시합니다. 편집 책임 {ed.name}.</>}</p>
|
||||
<p>{isEn && sideEffectEn ? sideEffectEn : fact.sideEffectNotice}</p>
|
||||
<p><a href="/clinic">병원 정보</a> · <a href="/visit">방문 안내</a> · <a href="/about">이 사이트에 대해</a> · <a href="/corrections">정정 기록</a> · <a href={ed.email ? `mailto:${ed.email}` : '/corrections'}>정정 요청</a> · <a href="/editorial">편집 기준 (운영자용)</a></p>
|
||||
{noticePending && <p class="notice-pending">The English wording of these notices is pending clinic approval. The Korean original is shown below.</p>}
|
||||
<p>{sponsorText}</p>
|
||||
<p>{sideEffectText}</p>
|
||||
{lang === 'ko' ? (
|
||||
<p><a href="/clinic">{u.foot_clinic}</a> · <a href="/visit">{u.foot_visit}</a> · <a href="/plan">{u.foot_plan}</a> · <a href="/about">{u.foot_about}</a> · <a href="/corrections">{u.foot_corrections}</a> · <a href={ed.email ? `mailto:${ed.email}` : '/corrections'}>{u.foot_request}</a> · <a href="/editorial">{u.foot_editorial}</a></p>
|
||||
) : (
|
||||
<p><a href="/en#clinic">{u.foot_clinic}</a> · <a href="/en#visit">{u.foot_visit}</a> · <a href="/en/plan">{u.foot_plan}</a> · <a href="/about">{u.foot_about}</a> · <a href="/corrections">{u.foot_corrections}</a> · <a href={ed.email ? `mailto:${ed.email}` : '/corrections'}>{u.foot_request}</a></p>
|
||||
)}
|
||||
</div>
|
||||
<div>
|
||||
{has(S.logoFoot?.src) && <p><img src={S.logoFoot.src} alt={S.logoFoot.alt} width={S.logoFoot.width} height={S.logoFoot.height} style="width:138px;height:auto;margin-bottom:0.5rem" /></p>}
|
||||
<p><strong>{v(f.name)}</strong></p>
|
||||
<p>{v(f.address?.full)}<br />전화 {v(f.phone)} · 팩스 {v(f.fax)}<br />대표 {v(f.representative)} · 사업자등록번호 {v(f.businessNo)}</p>
|
||||
<p>{has(f.url) && <a href={f.url} rel="noopener">공식 홈페이지</a>}{has(surface('youtube').url) && <> · <a href={surface('youtube').url} rel="noopener">유튜브</a></>}{has(surface('gangnamunni').url) && <> · <a href={surface('gangnamunni').url} rel="noopener">강남언니</a></>}</p>
|
||||
<p><strong>{lang === 'en' ? EN.name : v(f.name)}</strong></p>
|
||||
<p>{lang === 'en' ? EN.address.full : v(f.address?.full)}<br />{u.foot_phone} {v(f.phone)} · {u.foot_fax} {v(f.fax)}<br />{u.foot_rep} {v(f.representative)} · {u.foot_biz} {v(f.businessNo)}</p>
|
||||
<p>{lang === 'en' && has(f.urlEn) ? <a href={f.urlEn} rel="noopener">{u.foot_site}</a> : has(f.url) && <a href={f.url} rel="noopener">{u.foot_site}</a>}{has(surface('youtube').url) && <> · <a href={surface('youtube').url} rel="noopener">{u.foot_youtube}</a></>}{has(surface('gangnamunni').url) && <> · <a href={surface('gangnamunni').url} rel="noopener">{u.foot_gu}</a></>}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrap-wide powered">AI Discovery · Built with INFINITH</div>
|
||||
|
||||
Reference in new issue
Block a user