Strange behaviour in 0.147.6

I do with .Resources.GetMatch to work with my images residing in page bundles, then do some processing. en is not the default language for my site.

One of my page bundles has an image named en.jpg. In 0.147.5 the .RelPermalink I have from it is /en/posts/2020/handwriting/en_hu_a36601d23d3676b7.jpg, as expected.

0.147.6 renders the same link as en.jpg.

Is this a possible regression, or should I dig into my code and adapt for 0.147.6? This is the only thing in diff of my site as generated by 0.147.6 vs 0.147.5.

I am unable to reproduce the problem:

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

Perhaps there’s something different about your site/setup.

It’s possiblty related to Template for shortcode not found · Issue #13740 · gohugoio/hugo · GitHub – which I now slightly regret to have fixed.

I’m not sure what’s happening in your case, but for files where language code is one of the potentifal identifiers (content files, layout files), I don’t understand why you need to name it the way you do.

Yes, indeed. My further investigation showed that in a page bundle like:

content/
└── page-1/
    ├── index.en.md
    └── en.jpg

the file en.jpg is no longer a part of the English page bundle (English being non-default language of the site) in 0.147.6 (which is a change from 0.147.5).

It turns out I coded a “pass verbatim” fallback for the files not found in the page bundle, and that’s what caused the exact behaviour I’m witnessing.

It’s not that I need to, it’s that it used to work as expected.

Renaming the particular file isn’t that big a deal in my case, surely. I just wanted to highlight the regression in case you were interested.

The behavior you noted occurs with sites translated by filename. It does not occur with sites translated by directory.

Regardless, please rename your files.

It’s fine by me to revert the fix if it introduces new issues.