I have a project with relative links and I have been happy with the way it’s build and how Hugo creates all those relative paths. However there is now one specific use case for which I do not want that: error pages. Those do not have a single specific URL, so relative paths to CSS and image resources make no sense, unless I can set a base tag in the html head. I have been trying to do that, but Hugo will always substitute the href like href=”/error/404” becomes href=”../../error/404”.
Is there any way I can make Hugo just leave this one specific href as is?
Thanks for your reply! Yes, I am using relativeURLs = true
This is primarily about the 404 error page (and 403 for directories without an index.html). And because the 404 page will be served for any resource not present on the server, there may be any number of forward slashes in the path requested by the browser, which will then by default interpret any relative URLs based on that.
Too bad this cannot be done with Hugo in this configuration. I will probably make simple static error pages then.