Just wanted to check whether my understanding or configuration is right, before submitting a bug.
It seems related to #12167 but there seems to be a missing case.
The primary language is English, and a few of my posts, exist only in Greek. As in the following example, post2
exists in both languages, but post1
only exists in Greek. Each of them has a markdown image tag such as ![](./cover2.jpg)
.
The cover1.jpg
image is neither displayed nor exists in the /public/
folder, but cover2.jpg
image is displayed without any issues in the respective post.
Shouldn’t the images just work in both cases?
Example content tree:
content/
├── post1/
│ ├── index.el.md
│ └── cover1.jpg
└── post2/
├── index.el.md
├── index.en.md
└── cover2.jpg
I also tried {{ (.Resources.ByType "image") }}
in a template, and indeed it’s empty for the first bundle. The images are only recognized as resources when a index.en.md
is created in the post1/
directory. Changing the defaultContentLanguage
to the secondary language also resolves this.
I tried several past versions of Hugo and as expected this is only introduced after v0.123.
My configuration (see full config) as follows:
defaultContentLanguage: en
languages:
en:
weight: 1
languageName: English
languageCode: en
el:
weight: 2
languageName: Ελληνικά
languageCode: el
My arguments, if that helps: hugo.exe server -O -D --port=1313 --noHTTPCache --disableFastRender
PS: Related previous discussion: Issue with images in a multilingual multihost configuration