For some reason my images are not rendered in the public folder. Not sure if I can do this in my code but I looking for some icons to load depending on the language.
This is the code of my header.html in my partials:
As mentioned by last comment by @razon , it seems a file name issue. The language name in hugo.yaml start with capital letter while your image file name are all small letters. You can change the file names to match the language names and see if it works.
I was thinking the same, but it’s not working either.
Indeed if I rename my files capitalizing them the result is worst.
This is the result in the console for English.webp and spanish.webp italian.webp. As you can see, the first console log for English is giving null for the capital one. It’s look weird to me.
It makes sense because as you said the .yaml config is indicating in capitals, console log for variable imageName is not capital (weird).
Thanks razon.
I do find the issue thanks to your code.
The issue was not a lower case one, rather than I forgot in my code to add RelPermalink to the variable $idioma (This is an error I have all the time) but I was to realize about it thanks to your code. So you in one way, you have the reason.