feat(supporters): 회복 일정 플래너를 템플릿·워커에 통합 (/plan·/en/plan), /recovery·/stay 를 /plan 으로 정리
- 템플릿: Planner.astro, lib/plan.ts·tour.ts, styles/plan.css, planStrings, pages plan·en/plan·404. Base 내비 회복 일정 → /plan, 언어 짝 /plan↔/en/plan, 옛 주소 리다이렉트(vercel.json), 사이트맵 - 워커 planner 단계(recovery 다음): scripts/build_planner_data.mjs 가 업종별 기본 규칙표(scripts/template/planner/procedures.plastic|derm.json)에 병원 시술 페이지 원문(recoveryNotes)을 matchKeywords 로 붙이고, 장소는 briefs/<clinic>/planner.places.json(큐레이션) 또는 범용 기본표(관광공사 기준 좌표)로 만든다 - 브리프: viewclinic·oracle 큐레이션 장소. 빈 템플릿(관광 데이터 없음)도 빌드·검증 통과(plan.test 14건) - 이전 세션의 미커밋 작업(피부과 수집·OCR·게이트·언어 스위치, stay 페이지 제거)도 이 커밋에 함께 들어감. docs/prd 변경은 제외 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
5c08fa97ab
commit
aa5b05227f
126 files changed
+12916
-2068
No files matched your search
@@ -9,6 +9,7 @@ import { readdirSync, readFileSync, statSync, existsSync, writeFileSync } from '
|
||||
import { join } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import * as R from './gate/rules.mjs';
|
||||
import { parse as parseHtml } from 'node-html-parser';
|
||||
|
||||
const here = (p) => fileURLToPath(new URL(p, import.meta.url));
|
||||
const DIST = here('../dist/');
|
||||
@@ -35,6 +36,12 @@ function walk(dir, out = []) {
|
||||
return out;
|
||||
}
|
||||
|
||||
function withoutRecoveryQuote(html) {
|
||||
const root = parseHtml(html);
|
||||
root.querySelectorAll('#recovery-quote').forEach((el) => el.remove());
|
||||
return root.toString();
|
||||
}
|
||||
|
||||
const findings = []; // { where, level, code, msg }
|
||||
const add = (where, list) => list.forEach((x) => findings.push({ where, ...x }));
|
||||
|
||||
@@ -47,6 +54,8 @@ const layoutNow = {};
|
||||
for (const f of files) {
|
||||
const html = readFileSync(f, 'utf8');
|
||||
const rel = f.replace(DIST, '/');
|
||||
// astro.config 의 redirects 가 만든 meta refresh 페이지(/stay → /recovery). 본문이 없으니 검사하지 않는다.
|
||||
if (/<meta http-equiv="refresh"/.test(html) && !/<h1\b/.test(html)) continue;
|
||||
const text = R.stripHtml(html);
|
||||
|
||||
// JSON-LD
|
||||
@@ -64,7 +73,9 @@ for (const f of files) {
|
||||
const h1 = (html.match(/<h1\b/g) || []).length; if (h1 !== 1) add(rel, [{ level: R.E, code: 'H1_COUNT', msg: `H1 ${h1}개 (1개여야 함)` }]);
|
||||
// 금칙 표현·홈페이지 중복·운영자 어휘·제목 화법
|
||||
add(rel, R.checkBannedBody(text));
|
||||
add(rel, R.checkHomeDuplicate(text, HOME_TEXT));
|
||||
// 홈페이지 40자 연속 일치(§3-11)는 글이 홈페이지 문장을 베끼는 것을 막는 규칙이다. /stay 의 "시술 후 관리 안내"(#recovery-quote)는
|
||||
// 출처 링크·확인일을 붙인 병원 원문 인용이라 설계상 일치하므로 그 블록만 빼고 본다. 금칙어·운영자 어휘 검사는 인용 블록에도 그대로 적용한다.
|
||||
add(rel, R.checkHomeDuplicate(/id="recovery-quote"/.test(html) ? R.stripHtml(withoutRecoveryQuote(html)) : text, HOME_TEXT));
|
||||
add(rel, R.checkOperatorVocab(text, rel));
|
||||
add(rel, R.checkHeadingEndings(html));
|
||||
// §12-2 (1) 글 첫 부분 지원 고지. site.sponsorNotice 가 켜져 있으면 error, 아니면 warn
|
||||
|
||||
Reference in new issue
Block a user