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:
1 parent
49c5e46f23
commit
622441e6aa
100 files changed
+6886
-174
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import { defineCollection } from 'astro:content';
|
||||
import { glob } from 'astro/loaders';
|
||||
import { z } from 'astro:schema';
|
||||
|
||||
const posts = defineCollection({
|
||||
loader: glob({ pattern: '**/*.md', base: './src/content/posts' }),
|
||||
schema: z.object({
|
||||
title: z.string(), // H1. 질문형 한 문장
|
||||
category: z.enum(['A', 'B', 'C', 'D', 'E', 'F', 'G']),
|
||||
categoryLabel: z.string(),
|
||||
qbIds: z.array(z.string()), // QB 120 문항 ID
|
||||
summary: z.array(z.string()).min(2).max(4), // 세 줄 요약 (직접 답변 블록)
|
||||
description: z.string(), // meta description
|
||||
author: z.string(), // authors.json id
|
||||
reviewer: z.string().optional(), // 감수자 id (physicians)
|
||||
reviewStatus: z.enum(['reviewed', 'pending']).default('pending'),
|
||||
reviewedAt: z.string().optional(), // 의학 검토 완료일. reviewed일 때 필수로 쓴다
|
||||
datePublished: z.string(),
|
||||
dateModified: z.string(),
|
||||
video: z.object({ id: z.string(), title: z.string(), channel: z.string(), speaker: z.string().optional(), published: z.string().optional() }).optional(),
|
||||
videos: z.array(z.object({ id: z.string(), title: z.string(), speaker: z.string().optional(), published: z.string().optional(), note: z.string().optional() })).default([]),
|
||||
gallery: z.array(z.object({ src: z.string(), alt: z.string(), caption: z.string() })).default([]),
|
||||
thumbnail: z.string().optional(),
|
||||
hero: z.object({ src: z.string(), alt: z.string(), caption: z.string() }).optional(),
|
||||
faq: z.array(z.object({ q: z.string(), a: z.string() })).default([]),
|
||||
sources: z.array(z.object({ label: z.string(), url: z.string(), accessed: z.string(), type: z.enum(['clinic', 'doctor', 'product', 'regulation', 'platform', 'secondary']).optional() })).default([]),
|
||||
history: z.array(z.object({ date: z.string(), note: z.string() })).default([]), // 갱신 기록. 화면에 그대로 노출
|
||||
tags: z.array(z.string()).default([]),
|
||||
}),
|
||||
});
|
||||
|
||||
export const collections = { posts };
|
||||
Reference in new issue
Block a user