estruyf / vscode-front-matter

Front Matter is a CMS running straight in Visual Studio Code. Can be used with static site generators like Hugo, Jekyll, Hexo, NextJs, Gatsby, and many more...
https://frontmatter.codes
MIT License
2.05k stars 84 forks source link

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

Open deb85 opened 1 year ago

deb85 commented 1 year ago

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.

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.

estruyf commented 1 year ago

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