Enhancement: Custom Script support for media files and folders #74

Closed
opened 2026-10-05 02:24:22 +02:00 by adam · 5 comments
Owner

Add an action on the media card to optimize the media its file size.

Add an action on the media card to optimize the media its file size. <!-- github-sync-id:992467246 -->
adam closed this issue 2026-10-05 02:24:22 +02:00
Author
Owner

I use imgix for delivering the file to the browser, with any transformations required for that place in the site design applied as transformation parameters in the URL. I tend to use shortcodes for image elements, or use the imgix URL in the preview.
So I try to keep my source files in the 'uploads' folder at their highest resolution and then transform them down with imgix to fit the design. The only downside to this, is that my media assets have to be pushed to the production server for imgix to see them and bring them down into my site preview. This means that I usually Push images live before the content is ready for production.

I use imgix for delivering the file to the browser, with any transformations required for that place in the site design applied as transformation parameters in the URL. I tend to use shortcodes for image elements, or use the imgix URL in the preview. So I try to keep my source files in the 'uploads' folder at their highest resolution and then transform them down with imgix to fit the design. The only downside to this, is that my media assets have to be pushed to the production server for imgix to see them and bring them down into my site preview. This means that I usually Push images live before the content is ready for production. <!-- github-comment-id:970715760 -->
Author
Owner

@zivbk1 I've also been thinking about doing integrations with imgix/cloudinary/... Although, I feel this should be a way to extend it, not the preferred way. As it would otherwise bring a dependency on these services.

Thinking about an offline (via node) and online (via APIs) optimization approach. If you happen to have contacts with any of these services, feel free to bring them in touch with this project, so we can discuss the possibilities.

@zivbk1 I've also been thinking about doing integrations with imgix/cloudinary/... Although, I feel this should be a way to extend it, not the preferred way. As it would otherwise bring a dependency on these services. Thinking about an offline (via node) and online (via APIs) optimization approach. If you happen to have contacts with any of these services, feel free to bring them in touch with this project, so we can discuss the possibilities. <!-- github-comment-id:971327110 -->
Author
Owner

That makes sense. I don't think you would need to do much for imgix support, as it would be up to the site developer to use the appropriate URL wherever images are used on the site and for the "Web Folder" source option you would just point to the root of your website.

You could get super fancy and allow someone to setup an AWS bucket and use that for the Source for imgix. Then you would need to use the S3 API to push/pull and list the images there as users upload files into the media library. This would be really nice for people who don't want to store all the assets in their Git repository.

I have worked with other projects where you set a maximum height and width for images uploaded to the git repo, and when you upload an image it transforms the file to be less than those limits. I could see something like this being pretty useful.

That makes sense. I don't think you would need to do much for imgix support, as it would be up to the site developer to use the appropriate URL wherever images are used on the site and for the "Web Folder" source option you would just point to the root of your website. You could get super fancy and allow someone to setup an AWS bucket and use that for the Source for imgix. Then you would need to use the S3 API to push/pull and list the images there as users upload files into the media library. This would be really nice for people who don't want to store all the assets in their Git repository. I have worked with other projects where you set a maximum height and width for images uploaded to the git repo, and when you upload an image it transforms the file to be less than those limits. I could see something like this being pretty useful. <!-- github-comment-id:971634150 -->
Author
Owner

As image optimisation requires local tools, I'll enhance the custom script functionality in order to allow you adding scripts for media files and folders.

With this enhancement, you'll have more extensibility capabilities and allows you to do much more.

As image optimisation requires local tools, I'll enhance the custom script functionality in order to allow you adding scripts for media files and folders. With this enhancement, you'll have more extensibility capabilities and allows you to do much more. <!-- github-comment-id:974237435 -->
Author
Owner

Now available in the v5.6.0 release

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