Missing image or resource issues in multilingual Hugo sites commonly appear since version v0.123.x 1 2. This occurs because Hugo tends to discard resources that are considered to have no “parent” if the article folder is not available in the primary language (default content language).
Here are two effective ways to fix this issue so your images appear again.
Solution 1: Using Headless Bundle and Subdirectory #
This approach forces Hugo to recognize the content folder as a valid bundle even if the original article only exists in the second language 1.
- Add an
index.mdfile inside your article folder (alongside the second-language article file such asindex.id.md). Fill the file with the following front matter:
---
headless: true
---- Update your Hugo configuration (
hugo.tomlorconfig.toml) by adding the following line:
defaultContentLanguageInSubdir = trueThis setting ensures the primary language also has its own subdirectory in the URL structure.
Important Note: Using this solution has consequences for the URL structure. All languages, including the first language, must have a language slug. For example, URLs will become /en/posts/ and /id/posts/. If you try to access /posts/ without a language code, the site will encounter an error.
Solution 2: Adding a Language Code to the Image Filename #
If you don’t want to change the URL structure or global configuration settings, you can use a file-specific naming approach 2.
Simply rename the image file by including the language code at the end of the filename before the extension.
- Example: If your article is in Indonesian (
id), rename the file fromcover1.jpgtocover1.id.jpg.
This helps Hugo directly associate the image with the corresponding language content, so the system will not discard it during the build process.
FAQ #
Why did this issue only appear in newer Hugo versions? Starting from version v0.123.0, Hugo simplified its logic in preparation for other content data sources. As a result, the system no longer automatically creates a “header bundle” for resources that lack a primary language file, which are then treated as resources to be discarded.
Do I always have to create a file in the primary language? Technically, creating a content page for the default language is the safest way for Hugo to recognize the bundle. However, with the filename solution (Solution 2), you can avoid the need to create additional text files.
Which Hugo versions are affected by this issue? This issue has been specifically reported in Hugo v0.123.x and later versions.
Conclusion #
The issue of missing images in second-language Hugo articles is caused by stricter multilingual logic changes regarding resource ownership. You can resolve it by enabling defaultContentLanguageInSubdir along with a headless file, or with the simpler approach of adding a language code to the image filename (e.g., .id.jpg). Choose the solution that best fits your site’s URL structure needs.