Paginate in subdirectories properly

Before, it was using `/index.html` instead of the `index.html` in the subdirectory specified in the `paginate_path` config setting. I used the blog posted in #878 as my test.

Fixes #878, #984.