By chance we discovered that during each build, Hugo would randomly inject a non-existing directory into an images URL causing a 404 for the image(s) and it is random to what links are broken. If we rebuild the site, the prior links that were incorrect would be corrected but other image links would have the injected directory. Rebuild again (seconds later), and other images would be broken and some fixed. This would happen without editing any files. There is no recognizable pattern to what images are broken during each build run. One would have to visit each page individually to find the 404’s.
Below is an example:
Hugo’s wrong generated link:
The expected URL should be:
If you see in the example above, hugo would (sometimes) spontaneously add
/12017/ directory to the URL - Obviously this is a date(?).
Take note that this didn’t start happening until the site would have about a dozen pages (built with the same single.html). The more blog pages added, the worst it becomes. Remove the pages (down to below the dozen threshold), the issue disappears.
Also, we have switched themes, run the build on different machines (windows, Linix, and on c9), and came to the same issue.
I am not sure where to go or look at this point. A colleague tried reporting a bug on GitHub, and the admin kept closing it saying it was not. So, any help here would be appreciated.
I can post any code here if you wish. I put up an open workspace on c9 at: