Skip to content

Data collection items preview is not working #76

@hendrikheil

Description

@hendrikheil

Currently, the ContentEditorCode component does not handle data collection items. Selecting a data collection file makes the editor appear, but does not display any code.

Content schema:

  docs: defineCollection({
    type: 'page',
    source: {
      include: '**',
      exclude: ['data/**'],
    },
    schema: createDocsSchema(),
  }),
  data: defineCollection({
    type: 'data',
    source: {
      include: 'data/**',
    },
    schema: z.object({
      title: z.string(),
    }),
  }),

I think the issue is two fold. For one any DatabasePageItem that does not have a body does not call setContent at all. See the code.

Changing that check to pass brings a second issue to light, where generateContentFromDocument does not handle custom document schemas properly.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions