Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Builtin pagination template doesn´t work with sub root in BaseURL and CanonifyUrls = "false" #1252
If .Site.BaseURL contain paths (e.g., example.com/en/), pagination doesn't work correctly. The variables URL, Next.URL, Prev.URL, etc. return incorrect values in the pagination templates, resulting in the following behavior:
I make it working by hacking the source code (hugolib/pagination.go) around line 276:
Since I am new to Hugo and haven't looked at the source codes before, can someone check this issue and fix it in a correct way?
For testing, I'm just using the default internal template and nothing special:
The full URLs are constructed by the browser. To be exact, the links to the pages in generated HTML looks like:
It should be:
OK, now I understand it.
The current workaround is to either set
Hmm, that sound a little bit strange. I guess this should be a safe bet, too:
added a commit
Aug 31, 2016
Note/Update: This issue is marked as stale, and I may have said something earlier about "opening a thread on the discussion forum". Please don't.
If this is a bug and you can still reproduce this error on the latest
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.