Enhancement: Store metadata in file next to original media file #477

Open
opened 2026-10-05 02:49:21 +02:00 by adam · 1 comment
Owner

Is your feature request related to a problem? Please describe.
Part of the point of a static file cms is to use the filesystem to organize data instead of a database.
Currently, the metadata for all media files is stored in a single .frontmatter/mediaDb.json file.

  • The relation between file and data is fragile, as it relies on full path names.
  • The meta of all files is contained within the same unprettified .json file.

Describe the solution you'd like
I would like to be able to have the metadata for media files stored in a file alongside the original:

/image.jpg
/image.meta.yml

Alternatives you have tried
I've seen this pattern used in a plugin for Grav flat file cms (php).

Additional context
The exact naming of this meta file could be configured, with various possible extensions like .json, .md, .yml...
This feature could be an optional alternative to the database file, or even used in combination, where Front Matter could replicate the data found in meta files into mediaDb.json, or vice versa.

**Is your feature request related to a problem? Please describe.** Part of the point of a static file cms is to use the filesystem to organize data instead of a database. Currently, the metadata for all media files is stored in a single `.frontmatter/mediaDb.json` file. - The relation between file and data is fragile, as it relies on full path names. - The meta of all files is contained within the same unprettified .json file. **Describe the solution you'd like** I would like to be able to have the metadata for media files stored in a file alongside the original: ``` /image.jpg /image.meta.yml ``` **Alternatives you have tried** I've seen this pattern used in a plugin for Grav flat file cms (php). **Additional context** The exact naming of this `meta` file could be configured, with various possible extensions like `.json`, `.md`, `.yml`... This feature could be an optional alternative to the database file, or even used in combination, where Front Matter could replicate the data found in meta files into `mediaDb.json`, or vice versa. <!-- github-sync-id:1806609672 -->
Author
Owner

Thanks @deb85 for this suggestion. I wonder if that would make things easier in the CMS, as that would mean we have to read many more files to render the media dashboard.

I get your point, although having 100 media files would mean 100 meta files. Using these files in your content media dashboard would mean 200 files must be processed, creating a slower experience.

Managing the media file means you also need to manage the metafile, so the system is also fragile.

In the upcoming release, there have been added some improvements when moving/deleting media file, but also a remap ability. You can check the following issue for more information around this: https://github.com/estruyf/vscode-front-matter/issues/623

Thanks @deb85 for this suggestion. I wonder if that would make things easier in the CMS, as that would mean we have to read many more files to render the media dashboard. I get your point, although having 100 media files would mean 100 meta files. Using these files in your content media dashboard would mean 200 files must be processed, creating a slower experience. Managing the media file means you also need to manage the metafile, so the system is also fragile. In the upcoming release, there have been added some improvements when moving/deleting media file, but also a remap ability. You can check the following issue for more information around this: https://github.com/estruyf/vscode-front-matter/issues/623 <!-- github-comment-id:1723126592 -->
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#477