I want to display an image which works both in Github preview and in the site. @bep provided an amazing example https://portable-hugo-links.netlify.com/ but in the example the image resides in a page bundle and I want to reuse the image in multiple pages so I want something as some directory in
I came across branch bundles but I guess some changes to the render-image file because the branch bundles are to accessed as regularpages and I am not able to achieve that in the render-image. The image-render uses
.Page.Resources to get the image. but that won’t get the ones outside the page bundle.
I also came across headless bundles but again I face problems in rendering the image in the preview properly. And also I don’t know if this is the best practice as compared to having resources.
How should I modify the render-image.html so that for an image
contents/images/img.png can be used in a page like
blogs/blog1.md by something like this ->
I am very confused as to what is the correct way. Any help is appreciated.