Skip to content

Add support for content collections injection #8

Open
@BryceRussell

Description

@BryceRussell

Currently, if a theme uses a Content Collection, the theme user has to either clone a template with the Content Collection or manually set it up inside their own project. It would be nice if themes had the ability to automatically inject Content Collections into a project. This could be accomplished using a library like ts-morph to read the content/config.ts file and inject a schema into the collections object

Goals:

  • Automatically generate and seed content collections
  • Automatically inject collection schemas into user's projects

Things to consider:

  • AIK uses recast for codegen, should this be done using ts-morph or recast?
  • Should this be a separate package, so others can use it too?
  • Should the codegen happen directly on the file or inside a Vite plugin behind the scenes, meaning a user will not be able to see the schema inside the config file?

Working prototype using ts-morph: https://github.com/BryceRussell/prototype-inject-collection

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedExtra attention is neededquestionFurther information is requested

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions