Enhancement: let users sort their files in media dashboard #140

Closed
opened 2026-10-05 02:28:47 +02:00 by adam · 25 comments
Owner

Is your feature request related to a problem? Please describe.
I don't want to go over several pages of media in order to find the image I want to insert.

Describe the solution you'd like
let me (and other users) sort their files, from A-Z, new to old and/or implement search to search for a specific image

Describe alternatives you've considered
alternative is to manually insert the link and not previewing the image in the dashboard

Additional context

**Is your feature request related to a problem? Please describe.** I don't want to go over several pages of media in order to find the image I want to insert. **Describe the solution you'd like** let me (and other users) sort their files, from A-Z, new to old and/or implement search to search for a specific image **Describe alternatives you've considered** alternative is to manually insert the link and not previewing the image in the dashboard **Additional context** - <!-- github-sync-id:1055310354 -->
adam closed this issue 2026-10-05 02:28:47 +02:00
Author
Owner

Thanks @LuiseFreese! It makes a lot of sense to have this functionality added to the media dashboard!

Thanks @LuiseFreese! It makes a lot of sense to have this functionality added to the media dashboard! <!-- github-comment-id:971374964 -->
Author
Owner

@LuiseFreese first implementation of the sorting for the media dashboard is completed. At the moment, only sorting based on the filename is supported.

Sorting by the creation/modified date is a bit tricky, as that can lead to performance issues depending on the number of files. Currently, the dashboard shows batches of 16 files, if we want to enable this type of sorting. The statistics of all files need to be fetched first before sorting can be accomplished.

@LuiseFreese first implementation of the sorting for the media dashboard is completed. At the moment, only sorting based on the filename is supported. Sorting by the creation/modified date is a bit tricky, as that can lead to performance issues depending on the number of files. Currently, the dashboard shows batches of 16 files, if we want to enable this type of sorting. The statistics of all files need to be fetched first before sorting can be accomplished. <!-- github-comment-id:971578127 -->
Author
Owner

Feel free to test out the latest beta which has the filename sorting in place.

Feel free to test out the latest beta which has the filename sorting in place. <!-- github-comment-id:971578664 -->
Author
Owner

I wonder if some kind of library caching option could be available. To make a pass through all the files and then store some data about them all in the media db file. Then when adding or deleting files you update the DB file as part of the operation, or run a sync manually or in the background. This way you are sorting/listing the data in the file and not requiring file read operations each time you open or sort the library.

I wonder if some kind of library caching option could be available. To make a pass through all the files and then store some data about them all in the media db file. Then when adding or deleting files you update the DB file as part of the operation, or run a sync manually or in the background. This way you are sorting/listing the data in the file and not requiring file read operations each time you open or sort the library. <!-- github-comment-id:971645948 -->
Author
Owner

@zivbk1 I have been thinking about that as well. Although I'm not a fan of syncing. Most of the time, it causes issues but thinking about a better and more robust solution.

Question to @LuiseFreese and @zivbk1. What do your asset folders look like? Is it one folder with all the files? Or multiple folders to structure the content?

If it is the last, it might less be an issue, as fewer files will be retrieved all at once than if you have all files in the root folder.

@zivbk1 I have been thinking about that as well. Although I'm not a fan of syncing. Most of the time, it causes issues but thinking about a better and more robust solution. Question to @LuiseFreese and @zivbk1. What do your asset folders look like? Is it one folder with all the files? Or multiple folders to structure the content? If it is the last, it might less be an issue, as fewer files will be retrieved all at once than if you have all files in the root folder. <!-- github-comment-id:971749487 -->
Author
Owner

I typically have a single 'uploads' folder under my 'static' folder in Hugo where I put all the images that are used in content and layouts. I don't tend to put any subfolders inside of it.
I do have some sites where all of my media assets (images, videos, binary files (PDF, ZIP, XLSX, etc.)) are in different folders, but the images folder doesn't have any subdirectories. These assets are not stored in my git repo. I put them in an S3 bucket and use CloudFront to expose the bucket to the world at a custom subdomain, like files.mydomain.com. The only downside to this is most editors can't just insert a path reference. In this case, I only ask the editors to use the asset filename in the content source or frontmatter parameter and I use shortcodes, partials, render hooks, etc. to use the correct URL to the asset when it is rendered to the browser. Having an integration to upload and list files in an S3 bucket would be awesome in the FM UI, because I could do this same trick with all my sites and get binaries out of my repo as much as possible.

I typically have a single 'uploads' folder under my 'static' folder in Hugo where I put all the images that are used in content and layouts. I don't tend to put any subfolders inside of it. I do have some sites where all of my media assets (images, videos, binary files (PDF, ZIP, XLSX, etc.)) are in different folders, but the images folder doesn't have any subdirectories. These assets are not stored in my git repo. I put them in an S3 bucket and use CloudFront to expose the bucket to the world at a custom subdomain, like files.mydomain.com. The only downside to this is most editors can't just insert a path reference. In this case, I only ask the editors to use the asset filename in the content source or frontmatter parameter and I use shortcodes, partials, render hooks, etc. to use the correct URL to the asset when it is rendered to the browser. Having an integration to upload and list files in an S3 bucket would be awesome in the FM UI, because I could do this same trick with all my sites and get binaries out of my repo as much as possible. <!-- github-comment-id:971978668 -->
Author
Owner

Those are good insights @zivbk1! For the media snippet, would it help for you that there is also a {filename} token besides the: mediaUrl, caption, and alt?

Those are good insights @zivbk1! For the media snippet, would it help for you that there is also a `{filename}` token besides the: mediaUrl, caption, and alt? <!-- github-comment-id:972609329 -->
Author
Owner

Yes, that would help with the DAM use case, where the files live outside of the repo.

Yes, that would help with the DAM use case, where the files live outside of the repo. <!-- github-comment-id:972611308 -->
Author
Owner

I have an images folder in my static folder for my Hugo site.. no subfolders :-)

I have an `images` folder in my `static` folder for my Hugo site.. no subfolders :-) <!-- github-comment-id:972657204 -->
Author
Owner

New beta version with support for macOS and Linux date sorting. The next step is to work on support for Windows.

New beta version with support for macOS and Linux date sorting. The next step is to work on support for Windows. <!-- github-comment-id:972827060 -->
Author
Owner

So it could already work on WSL2?

So it could already work on WSL2? <!-- github-comment-id:972830664 -->
Author
Owner

Hasn't been tested in WSL, but it could work. As WSL2 is "just" Linux.

Hasn't been tested in WSL, but it could work. As WSL2 is "just" Linux. <!-- github-comment-id:972833690 -->
Author
Owner

Windows support has been added as well. @LuiseFreese @zivbk1 could you verify this on the beta that it's working for you? I've tested it on my devices, but that is not always a good reference 😊

Windows support has been added as well. @LuiseFreese @zivbk1 could you verify this on the beta that it's working for you? I've tested it on my devices, but that is not always a good reference 😊 <!-- github-comment-id:972969906 -->
Author
Owner

I use GitPod, which I think uses a version of Ubuntu Linux. I'll test it later this morning.

I use GitPod, which I think uses a version of Ubuntu Linux. I'll test it later this morning. <!-- github-comment-id:972972582 -->
Author
Owner

@zivbk1 true! I've just tested it on a GitHub Codespace, there it seems to work too.

@zivbk1 true! I've just tested it on a GitHub Codespace, there it seems to work too. <!-- github-comment-id:972981134 -->
Author
Owner

Ok, I went back to the original file checks. As its performance is way better. 🙃

At least it was a good validation.

Ok, I went back to the original file checks. As its performance is way better. 🙃 At least it was a good validation. <!-- github-comment-id:973025293 -->
Author
Owner

I can confirm it works on Windows 10 and in WSL2 🚀🚀

I can confirm it works on Windows 10 and in WSL2 🚀🚀 <!-- github-comment-id:973997166 -->
Author
Owner

Thanks, @LuiseFreese for confirming this!

Thanks, @LuiseFreese for confirming this! <!-- github-comment-id:974108960 -->
Author
Owner

It works well in GitPod too! :D

It works well in GitPod too! :D <!-- github-comment-id:974186539 -->
Author
Owner

Thanks @zivbk1!

Thanks @zivbk1! <!-- github-comment-id:974187040 -->
Author
Owner

@estruyf can we define the sort options like we can with our content types?

@estruyf can we define the sort options like we can with our content types? <!-- github-comment-id:974715978 -->
Author
Owner

Not at the moment, but it could be a new option/property to be added.

Not at the moment, but it could be a new option/property to be added. <!-- github-comment-id:974778637 -->
Author
Owner

BTW @zivbk1 on what things do you want to sort your media?

BTW @zivbk1 on what things do you want to sort your media? <!-- github-comment-id:974848400 -->
Author
Owner

@estruyf Off the top of my head would be:

  • filename
  • size
  • date
  • title
  • alt text

The last two above would need to come from the media DB file if defined.

If there is a way to query/store the following data I could see them as useful also.

-width (px)
-height (px)

@estruyf Off the top of my head would be: - filename - size - date - title - alt text The last two above would need to come from the media DB file if defined. If there is a way to query/store the following data I could see them as useful also. -width (px) -height (px) <!-- github-comment-id:974855407 -->
Author
Owner

Now available in the v5.6.0 release

Now available in the `v5.6.0` release <!-- github-comment-id:977043685 -->
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#140