In short my problem is that {{< figure src="/finec-mgimo-footer.png" > }} points to http://localhost:1313/finec-mgimo-footer.png, and not to http://localhost:1313/finec-mgimo-v2/finec-mgimo-footer.png.
Any ideas how to change this behaviour appreciated
Looks like canonifyURLs = true solves this. Maybe for documentation there shoul dbe a special mention like “if you develop for Gihub Pages, use canonifyURLs = true”.
@alexandros, thanks for suggestion - /finec-mgimo-v2/finec-mgimo-footer.png does show the image, I’m just upset and confuse I have to be copying a part of my baseURL ( = "https://epogrebnyak.github.io/finec-mgimo-v2/") into figure - I would like to avoid that.
Did you try my suggestion? I do not quite gather from your reply that you did…
The above will not work because you are publishing to a sub-directory and the forward slash at the beginning of the image PATH will point to the domain host root, therefore the image will be 404.
That is why I suggested that you eliminate the first forward slash from your image PATH input.
figure src="/finec-mgimo-v2/finec-mgimo-footer.png" is the right path, whil figure src="finec-mgimo-v2/finec-mgimo-footer.png" will attempt to look at current folder and
constructs https://epogrebnyak.github.io/finec-mgimo-v2/logo/finec-mgimo-v2/finec-mgimo-footer.png
It is strange I cannot get rid of finec-mgimo-v2 at all in src.
As per the config you are using multilingual mode.
The image you want to publish exists under the following URL: https://epogrebnyak.github.io/finec-mgimo-v2/finec-mgimo-footer.png
In your project’s source code repo the image is located under: finec-mgimo-v2/static/finec-mgimo-footer.png
Let’s break down what you’re doing in the link you shared:
The link /static/finec-mgimo-footer.png is wrong because the /static/ folder does not need to be entered into the img link.
The img link /finec-mgimo-v2/finec-mgimo-footer.png that includes the subdirectory /finec-mgimo-v2/ does displays the sample published project, because as I said above the first forward slash points to the host root (you hadn’t shared that you are using multilingual mode above).
The link /finec-mgimo-footer.png again points to the host root domain (due to the first forward slash) but in this case https://epogrebnyak.github.io/ throws a 404 since your project is published under the /finec-mgimo-v2/ subdirectory (you haven’t included it like you did in image 2).
The link finec-mgimo-v2/finec-mgimo-footer.png is 404 because it points to https://epogrebnyak.github.io/finec-mgimo-v2/en/logo/finec-mgimo-v2/finec-mgimo-footer.png (it includes the language code and there is no image in this address).
The link /finec-mgimo-footer.png points to https://epogrebnyak.github.io/finec-mgimo-footer.png but again there is no image under the domain host root since your project resides under the /finec-mgimo-v2/ subdirectory.
The link finec-mgimo-footer.png again points to https://epogrebnyak.github.io/finec-mgimo-v2/en/logo/finec-mgimo-footer.png same as in image 4.
The link http://localhost:1313/finec-mgimo-v2/finec-mgimo-footer.png is wrong since we never enter the local server URL to construct a URL for a published asset.
Rather than hardcoding the PATH in a link to an image that resides under the static folder a better and more portable way would be to use either the absLangURL or the relLangURL functions.
It is a bit strange localhost link actually provides an image even ob published assets - something I introduced for local testing, but accidently shows an image even on built site.
"C:\Users\epogr\Documents\GitHub\finec-mgimo-v2\content\en\logo\index.md:35:41": unrecognized character in shortcode action: U+007C '|'. Note: Parameters with non-alphanumeric args must be quoted
No. The functions need to go in the figure shortcode template.
If you are using the Hugo internal figure shortcode you can copy its contents from here and place it in your project under /layouts/shortcodes/figure.html
Then modify line 5 of the template with something like: