템플릿 정보가 빌더·렌더러·백엔드에 따로 적혀 어긋나 있었다 — 백엔드 기본값이 없는 id 를 가리켰고, 음식점 강조색 오타, 섹션 간격이 빌더와 서버에서 달랐다. - shared/src/data/templates.json: 템플릿 4개(simple·magazine·retro·paper)와 업종별 허용·기본 - shared/lib/catalog.ts · backend/common/template_catalog.py: 같은 JSON 을 읽는다, 모르는 id 는 에러 - 저장·미리보기·발행에서 모르는 id 를 거절한다(site_service · site.py 422 · build_service 실패) - site: 레이아웃 등록표(basic·paper) + LayoutProvider, Shell→Frame, HomePage→SectionList - 연결 안 된 레이아웃 5개, 배치 고르기(variant), 서체 선택, 빌더 canvas/DevShowcase 삭제 - 빌더: 템플릿을 바꾸면 이전 템플릿이 켠 섹션을 끄고 안내 문구를 띄운다 - postgres-init/migrations/0023: stay-retro → retro, 병원 허용 밖은 NULL(운영 미적용) - Dockerfile·worker: 백엔드 이미지에 shared/src/data 복사 - docs: TEMPLATES.md 신설(세 폴더 역할·템플릿 추가·렌더링 순서), DATA_MODEL·ARCHITECTURE 등 갱신 shared·site·frontend tsc 통과, site vitest 통과, 백엔드 DB 없는 테스트 41 passed(DB 테스트 미실행) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
92 lines
3.5 KiB
TypeScript
92 lines
3.5 KiB
TypeScript
import {HeroCatchphrase} from '@site/sections/HeroCatchphrase';
|
|
import {ChevronDown, MapPin} from 'lucide-react';
|
|
import {useSite} from '@site/lib/site-context';
|
|
import {primaryImage} from '@site/seo/meta';
|
|
import {bookingLinks, unitSpec} from '@site/lib/derive';
|
|
|
|
// 높이를 100vh 하나로 잡지 않는다. 모바일 주소창이 접힐 때 글자가 뛴다.
|
|
export function HeroSection() {
|
|
const payload = useSite();
|
|
const {place, narrative} = payload;
|
|
const image = primaryImage(payload);
|
|
const spec = unitSpec(payload);
|
|
const links = bookingLinks(payload);
|
|
const locality = place.addressLocality ?? place.addressRegion;
|
|
|
|
// id="top" — 상단 로고와 하단 바의 '홈' 이 여기로 돌아온다.
|
|
return (
|
|
<section id="top" className="w-full">
|
|
<div
|
|
className="relative flex w-full items-end overflow-hidden"
|
|
style={{
|
|
backgroundColor: 'var(--tpl-inverse, #1c1917)',
|
|
color: 'var(--tpl-bg, #ffffff)',
|
|
minHeight: 'clamp(24rem, 62vh, 36rem)',
|
|
}}
|
|
>
|
|
{image && (
|
|
<div className="absolute inset-0 z-0">
|
|
<img
|
|
src={image.url}
|
|
alt={image.alt}
|
|
// 첫 화면 이미지는 지연 로딩하지 않는다 — LCP 가 그만큼 늦어진다.
|
|
fetchPriority="high"
|
|
decoding="async"
|
|
width={image.width}
|
|
height={image.height}
|
|
className="size-full object-cover object-center"
|
|
/>
|
|
{/* 글자가 놓이는 아래쪽만 덮는다. 고르게 덮으면 사진이 통째로 탁해진다. */}
|
|
<div
|
|
className="absolute inset-0"
|
|
style={{
|
|
background:
|
|
'linear-gradient(to top, color-mix(in srgb, var(--tpl-inverse, #1c1917) 88%, transparent) 0%, color-mix(in srgb, var(--tpl-inverse, #1c1917) 45%, transparent) 34%, transparent 66%)',
|
|
}}
|
|
/>
|
|
</div>
|
|
)}
|
|
|
|
<div className="shell relative z-10 pb-10 pt-24 sm:pb-12">
|
|
{locality && (
|
|
<p className="mb-3 inline-flex items-center gap-1 text-[length:var(--fs-xs)] opacity-100">
|
|
<MapPin className="size-3.5" />
|
|
<span>{locality}</span>
|
|
</p>
|
|
)}
|
|
|
|
{/* h1 은 페이지에 하나. 가게 이름이 들어가야 "○○ 홈페이지" 질의에 잡힌다. */}
|
|
<h1
|
|
className="serif"
|
|
style={{
|
|
fontSize: 'var(--fs-display)',
|
|
fontWeight: 'var(--tpl-heading-weight, 700)',
|
|
lineHeight: 1.15,
|
|
}}
|
|
>
|
|
{place.name}
|
|
</h1>
|
|
|
|
{/* 한 줄이 없으면 요약이라도 세운다 — 이름만 덩그러니 있는 첫 화면은 안내가 아니다. */}
|
|
{(narrative.tagline ?? narrative.heroSubline ?? narrative.summary) && (
|
|
<p className="measure mt-3 text-[length:var(--fs-lead)] leading-relaxed opacity-100">
|
|
<HeroCatchphrase>{narrative.tagline ?? narrative.heroSubline ?? narrative.summary}</HeroCatchphrase>
|
|
</p>
|
|
)}
|
|
|
|
{payload.units.length > 0 && (
|
|
<a
|
|
href="#units"
|
|
className="mt-6 inline-flex items-center gap-1 text-[length:var(--fs-sm)] font-medium underline-offset-4 opacity-100 transition-opacity hover:opacity-100"
|
|
>
|
|
<span>{spec.label} 보기</span>
|
|
<ChevronDown className="size-4" />
|
|
</a>
|
|
)}
|
|
</div>
|
|
</div>
|
|
|
|
</section>
|
|
);
|
|
}
|