Hello everyone,
I’ve created my custom Hugo theme that supports two languages. Each post in my blog is a page bundle, that contains all the necessary information: text and images. When I publish a two languages blog post with a single image inside then this image is copied to both versions of the generated blog post (discourse doesn’t allow me to insert more than 2 links, so an example is a bit artifitial):
- blog post: example[.]com/en/blog/2022/name/, example[.]com/blog/2022/name/,
- two copies of the same image: example[.]com/en/blog/2022/name/01-dsc07205.jpg, example[.]com/blog/2022/name/01-dsc07205.jpg,
- not only an original version of the image, but all the modifications are copied as well: example[.]com/en/blog/2022/name/01-dsc07205_hu70402d3e41aaca26c9feb38425d899ec_4685824_970x728_fit_q75_box.jpg, example[.]com/blog/2022/name/01-dsc07205_hu70402d3e41aaca26c9feb38425d899ec_4685824_970x728_fit_q75_box.jpg
This behaviour significantly increases storage consumption. Is it expected behaviour that any image and all its modifications are copied to each language version of the post? Or it’s a mistake in my theme? Is there a way to keep only one copy for each image in all translated versions of a post and have a link to it from all the translations? Or maybe it’s possible to tell Hugo using symlinks from translated page bundle to an original one?