I’m working on a site using the Hugo Bootstrap Premium theme and relative urls. Because of how relative urls are parsed by browsers, it means I must have every page have an ugly URL, no exceptions.
I’ve managed to make 99% of the site fine for my purposes, except for one thing: the pagination for the main page links to
./ for the first page rather than
I’ve looked at the theme pagination code and I don’t see anything usual in it that would override the default pagination behavior of Hugo, which should redirect the first page to
./index.html. Anyone have any idea of what could be overriding this default behavior?
And why is this? Just curious.
Basically, from how I understand it, relative pretty URLs don’t resolve correctly. Locally, they show the index of the file they point to, and when uploaded they become 404 pages.
I have to use relative URLs because I’ll be hosting the file for internal use by an organization, with the users SSH tunneling to access the file. This means the base URL will be something like
http://localhost:5000 but as there’s no guarantee a user will port forward to a certain number I have to use relative URLs instead.
OK, to your question.
I suspect your problem is solved in Hugo 0.18-DEV. If you have the ability to test that it would be great to get some feedback about it – and if it is still an issue, create an issue on GitHub, because this was (and hopefully not anymore) a bug.
This does solve the problem for the first page, but introduces a new bug related to pagination with ugly URLS: if you have a topic, named, say “Asgard” with the topic page
asgard.html, the pagination will try to go
asgard.html/page/. I’m guessing this is not intended behavior, so I’ll create an issue about it.