Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Multi-file frontmatter editing #239

Open
johnfuller opened this issue Jan 31, 2022 · 3 comments
Open

Enhancement: Multi-file frontmatter editing #239

johnfuller opened this issue Jan 31, 2022 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@johnfuller
Copy link

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.

@estruyf
Copy link
Owner

estruyf commented Jan 31, 2022

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. 🙏

@estruyf estruyf added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jan 31, 2022
@johnfuller
Copy link
Author

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.

@estruyf
Copy link
Owner

estruyf commented Feb 2, 2022

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

For number 2, let me know your findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants