Fix sitemap links for sites in subdirectories

This PR fixes the bug which causes sitemap to render incorrectly for sites in subdirectories.

For http://some.site/somedir, the links are rendered as:
`http://some.site/some-link.html` instead of `http://some.site/somedir/some-link.html`
this PR fixes this

Any suggestions on strategy to write tests for this ?