Since the image-processing instructions to Hugo will come in as one long “command,” you’d just be adding the parameters to the command. Here’s a simplified (non-responsive) version of how I do it in my imgh shortcode:
In your Markdown, you could call this as follows, assuming the image is within the same folder as the Markdown (if you wanted a 900x size rather than 1000x, for example):
I also have other questions regarding processing images and lazy loading.
I have been using Hugo for a few years for my personnal blog and never really thought of any improvements. Now I have more free time.
How can I apply custom resizing and filters on a per basis image, without shortcodes? Currently I put my .md posts in /posts and images in /static folder, inserting them in .md with ![exmple](/xxx.jpg "caption"), (when I use a shortcode to process an image or use the featured_image function I put images in /assets/images/xx.jpg ).
What about lazy loding, sometimes I would like to insert in a post 5,6 or more images. Should I think of using lazy loading and how to begin with this?
“How can I apply custom resizing and filters on a per basis image, without shortcodes?” — It may be possible to do that through Markdown render hooks, but I can’t say that would be any easier than shortcodes.
Lazy-loading is always a good idea, regardless of how many or how few images you’re including. Modern browsers handle it natively with loading="lazy"; if you need to work with older browsers, you could use something like vanilla-lazyload or lazysizes.
The lazy-loading is not from Hugo — it’s something modern browsers do if you supply the loading = lazy (Browser-level image lazy-loading for the web) — but, other than that, the answer to your question is “Yes.”