Hugo Static Site Generator v0.51/extended darwin/amd64
Im not sure if this a bug, but I found it a bit confusing.
I have this content structure in my project.
— content
------ca
----------page
----------index.md
------de
----------page
----------index.md
When I’m trying to run the project I receive an error /ca/ca/page/s_101_1.png: no such file or directory
because of this code
{{range $index, $value := $resources }}
{{if in $value.Name $filename.image}}
<img src="{{(index ($resources) $index.MediaType)}};base64, {{ readFile (index ($resources $index).Relpermalink | base64encode)}}" /
{{end}}
So the point is when I’m trying to get some image from a content directory in a specific language and process with code written above I can’t do this because of contentDir and url concatenation. I tried to figure out how could I achieve it playing with url and contentDir. So if there is a concatenation and I would set contentDir to default than I could get image s_101_1.png by this path /ca/page/s_101_1.png.
I really like your project, sorry if I misunderstand something or have not done enough research to work it out. I just wanna use image processing with absLangURL.
I’ve just updated part of the code, the place where Im receiving the error is {{readFile (index ($resources $index).Relpermalin | base64encode)}}. I’ll try to figure out something with an example code.
How you get $resources??
Do you use page bundles?
Dive deeper step by step - has the range elements? Do you get file names?
What do you have in $index and $value ? Let write it in the html file and check it out.
Thank you for your answer, but to convert file into bytecode I need to read the file first and I’m not able to do this. There is no error, but if you launch server and would follow page.html link there would be no preprocessed image.
data:image/png;base64,L3BhZ2UvaW1hZ2VfMS5wbmc= I receive this in the end