왜 빌드보다 먼저 검사해야 하나
구조화된 콘텐츠의 쉼표 하나, 빠진 번역 하나, 중복된 슬러그 하나가 전체 사이트 빌드를 막을 수 있습니다. 렌더러까지 실행한 뒤 원인을 찾기보다 데이터 자체를 먼저 검사하면 콘텐츠 오류와 렌더링 오류를 분리할 수 있습니다.
짧은 사전 검증 순서
1. 파일을 JSON 파서로 읽어 구문 오류가 없는지 확인합니다.
2. 각 항목에 slug, date, type, title, summary, body가 있는지 검사합니다.
3. 모든 슬러그가 고유하고 날짜 형식이 일관적인지 확인합니다.
4. ko, en, zh, ja가 제목·요약·본문에 모두 존재하는지 확인합니다.
5. 각 언어의 본문이 비어 있지 않고 다른 언어의 복사본이 아닌지 살핀 뒤 빌드를 실행합니다.
완료 기준
데이터 검증과 사이트 빌드를 별개의 단계로 두고 둘 다 통과해야 완료로 봅니다. 데이터 검증이 실패하면 먼저 해당 항목만 고치고 같은 검사를 다시 실행합니다. 이렇게 하면 큰 빌드 로그를 뒤지는 대신 가장 가까운 실패 지점에서 문제를 해결할 수 있습니다.
Why validate before the build?
A single misplaced comma, missing translation, or duplicate slug in structured content can stop an entire site build. Checking the data first separates content errors from rendering errors instead of making you trace the cause after the renderer has already started.
A short pre-build validation sequence
1. Read the file with a JSON parser and confirm that its syntax is valid.
2. Check that every entry contains slug, date, type, title, summary, and body.
3. Confirm that every slug is unique and that date formatting is consistent.
4. Ensure ko, en, zh, and ja are present in the title, summary, and body.
5. Verify that each language body is nonempty and is not a copy of another language, then run the build.
Completion bar
Treat content validation and the site build as separate stages, and require both to pass. If data validation fails, repair only the affected entry and repeat the same check first. This resolves the problem at its nearest failure point instead of forcing you to search through a much larger build log.
为什么要在构建前验证?
结构化内容中一个位置错误的逗号、一项缺失的翻译或一个重复的 slug,都可能让整个站点构建失败。先检查数据,可以把内容错误与渲染错误分开,避免等渲染器启动后再追查原因。
简短的构建前验证流程
1. 使用 JSON 解析器读取文件,确认语法有效。
2. 检查每个条目是否包含 slug、date、type、title、summary 和 body。
3. 确认所有 slug 都是唯一的,并且日期格式保持一致。
4. 确认标题、摘要和正文中都包含 ko、en、zh、ja。
5. 检查每种语言的正文都不为空,而且不是其他语言内容的复制,然后再运行构建。
完成标准
把内容验证和站点构建设为两个独立阶段,并要求两者都通过。如果数据验证失败,先只修正受影响的条目,再重复同一项检查。这样可以在最接近失败原因的位置解决问题,而不必翻查庞大的构建日志。
なぜビルド前に検証するのか
構造化コンテンツでは、カンマ一つの位置違い、翻訳一つの欠落、slug 一つの重複だけで、サイト全体のビルドが止まることがあります。データを先に確認すれば、レンダラーの起動後に原因を追うのではなく、コンテンツのエラーとレンダリングのエラーを分けられます。
短いビルド前検証の手順
1. JSON パーサーでファイルを読み、構文が有効であることを確認します。
2. 各項目に slug、date、type、title、summary、body があるか確認します。
3. すべての slug が一意で、日付形式が統一されていることを確認します。
4. タイトル、要約、本文のすべてに ko、en、zh、ja があることを確認します。
5. 各言語の本文が空ではなく、別の言語をコピーしたものでもないことを確かめてからビルドを実行します。
完了基準
コンテンツ検証とサイトビルドを別々の段階として扱い、両方の通過を完了条件にします。データ検証に失敗した場合は、影響を受けた項目だけを修正し、まず同じ検査を繰り返します。大きなビルドログを探し回る代わりに、失敗原因に最も近い地点で問題を解決できます。