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:
http://example.com/en/products/page/2/ (correct link) => http://example.com/products/page/2/ (links in generated pages)
I make it working by hacking the source code (hugolib/pagination.go) around line 276:
urlFactory := newPaginationURLFactory(section)
modified as:
urlFactory := newPaginationURLFactory(helpers.RelURL(section))
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?