Hi,
I would like to implement the new feature related to Image processing under Hugo 0.32.
I currently have a partial where the following code is implemented:
How to replace the code in the partial in order to replace css resizing by the new features.
Note that the image is located in the same folder than the article index.md.
Yes, I knew you knew. But I wanted to point that out to the thread starter and others, because if you only see the “shortcode side of it”, it is easy to miss out on the best part.
Thank you for the swift answer.
But as I am not a developer and the above example (paceup) doesn’t provide the associated code directly in the template, I have to admit that I cannot manage to implement the code correctly.
The Hugo 0.32 Howto codes provide examples to list ressources as far as I understand.
Desperately need some additional help
The .Resize takes width values. In your CSS you have set height: 20em;
You should first check what is the width value of your rendered image with your browser’s Dev Tools.
Also I noticed that your CSS refers to the first image in your article. It would be best for you to create a naming convention for these images that you are using as article covers.
Assuming that you are giving your images a prefix of cover your partial should become something like the following:
Just replace 1280x with the width value of your rendered image -as I mentioned above- and you’re good to go.
EDIT
Please note that the above snippet is only for the resize. If you want this image to be responsive on different view ports I think that you need to keep the CSS object-fit property that you already use.
Thank you for your help.
It works !
I tried to do it with png image (same prefix of cover) instead of jpg but it seems not possible.
Am i missing something ?