keystatic icon indicating copy to clipboard operation
keystatic copied to clipboard

collection with `**` path cannot use more than one mdx field

Open stefanprobst opened this issue 1 year ago • 0 comments

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

stefanprobst avatar May 19 '24 17:05 stefanprobst