Skip to content

collection with ** path cannot use more than one mdx field #1142

@stefanprobst

Description

@stefanprobst

this may just be a documentation issue, but using multiple mdx fields in a collection which allows nested paths does not work.

issue repro: https://github.com/stefanprobst/keystatic-mdx-nested

collection has:

  posts: collection({
    label: "Posts",
    slugField: "title",
    path: "./content/posts/**",
    format: { contentField: "content" },
    schema: {
      title: fields.slug({ name: { label: "Title" } }),
      summary: fields.mdx({
        label: "Summary",
      }),
      content: fields.mdx({
        label: "Content",
      }),
    },
  }),

a collection entry will be saved as:

content/posts/my-first-post.mdx
content/posts/my-first-post/summary.mdx

however, reader.collections.posts.list() will return both "my-first-post" and "my-first-post/summary" as entries, and both are also listed in the keystatic ui:

Screenshot_20240519_194036

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions