Why does that warning fails ?
I erased my image folder by mistake, restored it, and suddenly there’s that. This is a version from a backup so I don’t understand. It worked just before.
template: _default/_markup/render-image.html:14:9:
executing "_default/_markup/render-image.html" at <$img>:
wrong type for value; expected string; got *resources.resourceAdapter
trying to get the .Width results in : Error: Error building site: "/home/drm/WEBSITE/content/docs/Love/homo_nazi_en.md:1:1": "_default/_markup/render-image.html" at <$img.Width>: wrong type for value; expected string; got int
I am not using minify.
execute of template failed: template: _default/_markup/render-image.html:66:11: executing “_default/_markup/render-image.html” at <$medium.RelPermalink>: can’t evaluate field RelPermalink in type string
I stressed that it has created three processed versions already, that one:
Error: Error building site: “/home/drm/sample/content/_index.md:1:1”: “/home/drm/sample/themes/hugo-book/layouts/_default/_markup/render-image.html:7:7”: execute of template failed: template: _default/_markup/render-image.html:7:7: executing “_default/_markup/render-image.html” at <$img.RelPermalink>: nil pointer evaluating resource.Resource.RelPermalink
Built in 68 ms
There is ONLY one image, and it’s not the same as before.
I’m a bit suspicious of 3500 wide webp image that is 12MB in size, I use 4K jpgs as source images and the max is around half that size and they are more detailed images.
The site did build though.
Personally I’d lowercase your Images folder - Images and lmages look way too similar (the first is with capital i the second with lowercase L)
As well as case issues with some servers.
your code works yes but no image is processed at all ?
I don’t understand that code at all, I’ll have trouble editing it !
Do I start now or am I waiting for more ? Also, an idea what’s wrong with .Resize ?
Individually each image weights as it should, it’s just that I have a bunch of them. Some are enormous, that’s why I process them. But I want people to access the full res ones when clicking on the displayed version so they’re in assets.
The hook I provided is an example of defensive coding. It prevents the nil pointer error that you reported earlier in this thread, and instead tells you if it cannot find a resource.
Since you didn’t get an error, it found a resource.
But if it didn’t display, then perhaps the resource isn’t an image.
Please post the HTML that was generated for that image (I don’t want to see anything else).
Thanks for your efforts, it allowed me to find the culprits without modifying and trying to build a million times. I feel like several things stacked up. Subpaar code (I suppose, not proven though !), image folder not totally updated, perhaps a gift from my text editor too.
Now my baby is entirely back