contentlayerdev / contentlayerdev/contentlayer

Our terminology around documents, nested, and types is confusing

Đang mở
#226 1 bình luận 2 reaction 0 người được giao Xem trên GitHub
meta: feedback-wanted meta: never-stale
Ngôn ngữ chính
TypeScript
Star
3.5k
Fork
192
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

This is coming from #225. All of these things are different within the context of Contentlayer:

- _Document_ is a generated piece of content.
- _Document Type_ is a group of content of a similar shape.
- _Nested Type_ is a repeatable group of content using within document types
- _Type_ is an auto-generated TS type for every document and its nested types.

Aside from the nuance of difference between "document" and "nested" (covered in #225), I'm finding our use of "type" to clash with our heavy use of TypeScript and in auto-generating TS type definitions.

If we were to pursue #225, we could simplify our terminology like so:

- _Model_ or _Content Type_ is a group of any type of content.
- _Document_ is the generated data file.
- _Type_ is the generated TS definition.

Example: A `Post` model defines the shape of content in the `content/posts` directory. Contentlayer processes this content according to the model definition, and then generates a _document_ for every post, along with a TS _type_ definition.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.