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,5 @@
|
||||
{
|
||||
"_comment": "픽스처 전용 작성자·검토자. 사이트의 authors.json과 무관하게 테스트가 돌도록 한다.",
|
||||
"supporters": { "ansm": { "name": "픽스처 편집자", "role": "편집 책임", "email": "", "sameAs": [] } },
|
||||
"physicians": { "dr-choi": { "name": "픽스처 원장", "title": "원장 · 성형외과 전문의", "credentials": [], "url": "https://example.com/dr", "sameAs": [] } }
|
||||
}
|
||||
@@ -13,7 +13,9 @@ const here = (p) => fileURLToPath(new URL(p, import.meta.url));
|
||||
const FIX = here('./fixtures/');
|
||||
const POSTS = here('../../src/content/posts/');
|
||||
const authors = JSON.parse(readFileSync(here('../../src/data/authors.json'), 'utf8'));
|
||||
const ctx = { physicians: authors.physicians, supporters: authors.supporters };
|
||||
const ctx = { physicians: authors.physicians, supporters: authors.supporters }; // 실제 글 회귀용
|
||||
const fx = JSON.parse(readFileSync(join(FIX, '_authors.json'), 'utf8'));
|
||||
const fxCtx = { physicians: fx.physicians, supporters: fx.supporters }; // 픽스처용
|
||||
const base = yaml.load(readFileSync(join(FIX, '_base.yml'), 'utf8'));
|
||||
|
||||
let pass = 0, failCount = 0;
|
||||
@@ -26,7 +28,7 @@ for (const f of readdirSync(FIX).filter((x) => x.endsWith('.md'))) {
|
||||
const { data, body } = R.parseMarkdown(readFileSync(join(FIX, f), 'utf8'));
|
||||
const { expect = [], ...fm } = data;
|
||||
const merged = { ...base, ...fm };
|
||||
const got = codes(R.checkPostSource({ data: merged, body }, ctx));
|
||||
const got = codes(R.checkPostSource({ data: merged, body }, fxCtx));
|
||||
const missing = expect.filter((c) => !got.includes(c));
|
||||
const extra = got.filter((c) => !expect.includes(c));
|
||||
if (missing.length) bad(f, `기대한 오류가 안 나옴: ${missing.join(', ')} (실제: ${got.join(', ') || '없음'})`);
|
||||
@@ -51,7 +53,7 @@ for (const f of readdirSync(POSTS).filter((x) => x.endsWith('.md'))) {
|
||||
const errs = R.checkPostSource(parsed, ctx).filter((x) => x.level === R.E);
|
||||
if (errs.length) { postErrors += errs.length; errs.forEach((e) => bad(`posts/${f}`, `[${e.code}] ${e.msg}`)); }
|
||||
}
|
||||
if (!postErrors) ok('src/content/posts 전편', '소스 규칙 error 0');
|
||||
if (!postErrors) ok('src/content/posts 전편', `소스 규칙 error 0 (${readdirSync(POSTS).filter((x) => x.endsWith('.md')).length}편)`);
|
||||
|
||||
// 4) 부정문·임상 의견 표기는 통과해야 한다 (정답지에 실제로 있는 문장)
|
||||
const negatives = [
|
||||
|
||||
Reference in new issue
Block a user