You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[GitHub의 블로그 튜토리얼 데모 코드](https://github.com/withastro/blog-tutorial-demo/tree/content-collections/src/pages)의 `src/pages/` 폴더를 살펴보면 블로그 게시물 목록, 태그 페이지 등과 같은 블로그 기능을 위해 컬렉션으로부터 페이지를 생성하는 전체 예시를 확인할 수 있습니다!
567
567
:::
568
568
569
+
## 컬렉션 JSON 스키마
570
+
571
+
<p><Sincev="4.13.0" /></p>
572
+
573
+
Astro는 컬렉션용 [JSON 스키마](https://json-schema.org/) 파일을 자동으로 생성하며, 이를 편집기에서 사용하면 데이터 파일에 대한 IntelliSense 및 타입 검사를 받을 수 있습니다.
574
+
575
+
프로젝트의 각 컬렉션에 대해 JSON 스키마 파일이 생성되어 `.astro/collections/` 디렉터리에 출력됩니다.
576
+
예를 들어, `authors`와 `posts`라는 두 컬렉션이 있다면, Astro는 `.astro/collections/authors.schema.json`와 `.astro/collections/posts.schema.json`을 생성합니다.
577
+
578
+
### JSON 파일에서 JSON 스키마 사용하기
579
+
580
+
JSON 파일에서 `$schema` 필드를 설정하여 Astro가 생성한 스키마를 직접 지정할 수 있습니다.
581
+
값은 데이터 파일에서 스키마까지의 상대 파일 경로여야 합니다.
582
+
다음은 `src/data/authors/`에 있는 데이터 파일이 `authors` 컬렉션용으로 생성된 스키마를 사용하는 예시입니다.
자세한 내용은 Red Hat YAML 확장 기능 문서의 [“Associating schemas”](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml#associating-schemas)를 참조하세요.
635
+
569
636
## 컬렉션 생성이 필요한 경우
570
637
571
638
관련된 데이터나 콘텐츠가 공통 구조를 공유하는 그룹이 있을 때마다 [컬렉션을 생성](#컬렉션-정의)할 수 있습니다.
0 commit comments