Skip to content

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

Open
@seancdavis

Description

@seancdavis

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions