Multi-language images and page bundles

Try this:

git clone --single-branch -b hugo-forum-topic-37325 https://github.com/jmooring/hugo-testing hugo-forum-topic-37325
cd hugo-forum-topic-37325
hugo server

You would start with one image, to be displayed for all languages:

content/about/
├── example.png
├── index.es.md
└── index.md

Your markdown for all languages would be: [1]

![example](example.png "This is an example")

At some point you create a language-specific version of an image:

content/about/
├── example.es.png
├── example.png
├── index.es.md
└── index.md

And it will just… work. No changes to markdown are required.

If you will need to reference images in your static directory using markdown, you must mount the static directory to assets.

[[module.mounts]]
source = 'assets'
target = 'assets'
[[module.mounts]]
source = 'static'
target = 'assets'

Finally, as to whether or not the existing behavior is expected, see:
https://github.com/gohugoio/hugo/issues/9557


  1. The alt and title attributes would be localized of course. ↩︎

2 Likes