How do I output multiple properties of a datafile? #331

Closed
opened 2026-10-05 02:40:46 +02:00 by adam · 2 comments
Owner

Let's say I have the following datafile:

"frontMatter.data.files": [
  {
    "id": "authors",
    "title": "Authors",
    "file": "[[workspace]]/.frontmatter/content/people.json",
    "fileType": "json",
    "labelField": "name",
    "schema": {
      "title": "Authors",
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "title": "Name"
        },
        "slug": {
          "type": "string",
          "title": "Slug"
        }

I'd like to generate the following schema in my mdx file:

author:
  name: Dorothy Parker
  slug: dorothy-parker

Is this possible somehow?

Let's say I have the following datafile: ``` "frontMatter.data.files": [ { "id": "authors", "title": "Authors", "file": "[[workspace]]/.frontmatter/content/people.json", "fileType": "json", "labelField": "name", "schema": { "title": "Authors", "type": "object", "properties": { "name": { "type": "string", "title": "Name" }, "slug": { "type": "string", "title": "Slug" } ``` I'd like to generate the following schema in my mdx file: ``` author: name: Dorothy Parker slug: dorothy-parker ``` Is this possible somehow? <!-- github-sync-id:1369051750 -->
adam closed this issue 2026-10-05 02:40:46 +02:00
Author
Owner

@jordanlambrecht, thanks for opening an issue around this topic. Currently, this is not yet supported, as originally, the feature got implemented to use the dataFileKey as a single reference to the data record and let the SSG or framework handle the rest.

That said, we can support this by introducing a new property like additionalFields which get added like you suggest in your issue.

@jordanlambrecht, thanks for opening an issue around this topic. Currently, this is not yet supported, as originally, the feature got implemented to use the `dataFileKey` as a single reference to the data record and let the SSG or framework handle the rest. That said, we can support this by introducing a new property like `additionalFields` which get added like you suggest in your issue. <!-- github-comment-id:1243359190 -->
Author
Owner

Long overdue, but this will be possible with the new dataFileAdditionalFields property on the dataFile field.

Long overdue, but this will be possible with the new `dataFileAdditionalFields` property on the `dataFile` field. <!-- github-comment-id:4787939290 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#331