Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Our terminology around documents, nested, and types is confusing #226

Open
seancdavis opened this issue May 17, 2022 · 1 comment
Open

Comments

@seancdavis
Copy link
Collaborator

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.

@iamnbutler
Copy link

Huge +1 on moving away from using Type anywhere. I think that would be a really positive change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants