My defaultContentLanguage is set to de. I use the localized _index.md files to build a menu for each language. When compiling this site, the image mail-address.png is only copied to the de site but not to en. If I open the de-Site, the image is correctly shown but not on the en.
Things I tested:
Localize the image with mail-address.en.png and mail-address.de.png: This works but leads to duplicated files in my repo for each language even though the content is the same. From hugos perspective these might be even two different files.
Is there any way to reference the image from both files Benutzerverwaltung.en.md and Benutzerverwaltung.de.md as mail-address.png and have it shown on both languages?
I’m not sure I completely understand your objective, but converting Benutzerverwaltung into a page bundle works great:
content/
├── App1/
│ ├── Verwaltung/
│ │ ├── Benutzerverwaltung/
│ │ │ ├── resources/
│ │ │ │ └── mail-address.png
│ │ │ ├── index.de.md <-- file name does not begin with underscore
│ │ │ └── index.en.md <-- file name does not begin with underscore
│ │ ├── _index.de.md
│ │ └── _index.en.md
│ ├── _index.de.md
│ └── _index.en.md
├── _index.de.md
└── _index.en.md
Example:
git clone --single-branch -b hugo-forum-topic-50950 https://github.com/jmooring/hugo-testing hugo-forum-topic-50950
cd hugo-forum-topic-50950
hugo server
This assumes that you have not created a link render hook, and that the themes/modules you are using are not supplying a link render hook.