Closed bugok closed 4 months ago
I think this might be a hugo bug, related to the usage of relativeURLs
.
I searched github for websites which use relativeURLs
: https://github.com/search?q=%22relativeURLs%3A+true%22+path%3A%2F%5Econfig%5C.yaml%2F&type=code
Examples:
All of them showed with the same behavior - when loading the a two-part, non-existent path - the 404 page can't load static content.
Issue description
When accessing a two-level, non existent path of a website, css and js files don't load.
Accessing my website at https://www.noamlerner.com works great. Accessing https://www.noamlerner.com/nonexistent results with a 404 with a page which can load the css and js files. However, accessing https://www.noamlerner.com/nonexistent/another results with a 404 response, but css and js files can't load.
Looking at the developer tools console I see that the static content is trying to be retrieved from: https://www.noamlerner.com/nonexistent/. For example:
For context, I am using the relativeURLs: true option in my hugo config. You can see in this discussion why: https://github.com/jpanther/congo/discussions/857.
Theme version
v2.8.1
Hugo version
hugo v0.125.3-474c4c02212cf97712c6fbf4159c68822ea6e078+extended darwin/arm64 BuildDate=2024-04-22T17:18:35Z VendorInfo=brew
Which browser rendering engines are you seeing the problem on?
Chromium (Google Chrome, Microsoft Edge, Brave, Vivaldi, Opera, etc.)
URL to sample repository or website
https://www.noamlerner.com/ldsjfkdsjfn/sldjfkdsjb
Hugo output or build error messages