Enhancement: Multi-file frontmatter editing #190

Open
opened 2026-10-05 02:32:27 +02:00 by adam · 3 comments
Owner

An obvious need when dealing with markdown files is making changes to a "schema" of frontmatter data. Maybe I decide to add a field to my frontmatter, but I have a large number of files which I would need to apply this change to.

There may be a multi-layered approach to this problem. The first step may be in batch adding / removing a field. The next step may be defining the field type. One possible type, might be a an option which would provide for quick entry from a UI control (from a list, from a date picker.) As part of a quick entry UI, it may be useful to create a spreadsheet view where you can edit any field in a list of files.

This approach of editing frontmatter may also require regeneration of the entire front-matter from the template so that fields don't get orphaned. Maybe certain fields could be explicitly ignored so that they aren't overwritten.

I have been looking all over for something with this functionality and there doesn't seem to be good options unless you're willing to write scripts.

An obvious need when dealing with markdown files is making changes to a "schema" of frontmatter data. Maybe I decide to add a field to my frontmatter, but I have a large number of files which I would need to apply this change to. There may be a multi-layered approach to this problem. The first step may be in batch adding / removing a field. The next step may be defining the field type. One possible type, might be a an option which would provide for quick entry from a UI control (from a list, from a date picker.) As part of a quick entry UI, it may be useful to create a spreadsheet view where you can edit any field in a list of files. This approach of editing frontmatter may also require regeneration of the entire front-matter from the template so that fields don't get orphaned. Maybe certain fields could be explicitly ignored so that they aren't overwritten. I have been looking all over for something with this functionality and there doesn't seem to be good options unless you're willing to write scripts. <!-- github-sync-id:1119724522 -->
Author
Owner

When using content types with Front Matter, you can define the type in your pages. That way we know which fields should be used.

There is no way to change and update all fields (or single fields) at once.

I kind of like the data view approach where you would be able to quickly edit fields and their values.

Thanks for the feedback and future feature implementation. 🙏

When using content types with Front Matter, you can define the type in your pages. That way we know which fields should be used. There is no way to change and update all fields (or single fields) at once. I kind of like the data view approach where you would be able to quickly edit fields and their values. Thanks for the feedback and future feature implementation. 🙏 <!-- github-comment-id:1026052149 -->
Author
Owner

I guess this would have been multiple issues then.

  1. Spreadsheet like view for editing front-matter for multiple files. Example
  2. A workflow for enforcing a schema based on the type.

For 2, my use-case would be quickly updating frontmatter which has fields which aren't defined as part of the type. Maybe this could be an action associated with a "strict" mode which would give you an option for removing items which aren't part of the schema. One of the pains of dealing with large numbers of markdown files is keeping the frontmatter consistent.

I don't know that the 1rst item is possible with this environment. The 2nd item should be doable. I'm just adding this for documentation. I'll take a closer look when I'm able to free up some time. If the 2nd item is doable with an action, then I could probably knock that out myself and then update this thread.

I guess this would have been multiple issues then. 1. Spreadsheet like view for editing front-matter for multiple files. [Example](https://github.com/ognjenio/front-matter-editor) 2. A workflow for enforcing a schema based on the type. For 2, my use-case would be quickly updating frontmatter which has fields which aren't defined as part of the type. Maybe this could be an action associated with a "strict" mode which would give you an option for removing items which aren't part of the schema. One of the pains of dealing with large numbers of markdown files is keeping the frontmatter consistent. I don't know that the 1rst item is possible with this environment. The 2nd item should be doable. I'm just adding this for documentation. I'll take a closer look when I'm able to free up some time. If the 2nd item is doable with an action, then I could probably knock that out myself and then update this thread. <!-- github-comment-id:1026705063 -->
Author
Owner

Thank you @johnfuller for the example, this gives us a good look at what we need.

For number 2, let me know your findings.

Thank you @johnfuller for the example, this gives us a good look at what we need. For number 2, let me know your findings. <!-- github-comment-id:1027669266 -->
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#190