getpelican/pelican — pull request #1366 by Scheirle (2014-06-05 13:13:12+00:00)
Title: Fixes wrongly generated relative urls for pagination.

When `RELATIVE_URLS` is `True` and the `PAGINATION_PATTERNS` adds folder to the path, the relative urls to these pages does not respect these additional folders.

Example:
Settings:

RELATIVE_URLS = True
PAGINATION_PATTERNS = (
(1, '{base_name}/', '{base_name}/index.html'),
(2, '{base_name}/page/{number}/', '{base_name}/page/{number}/index.html'),)

Theme:

If you are on page 2 then `{{ SITEURL }}/theme/css/style.css` expands to `./theme/css/style.css` instead of `./../../theme/css/style.css`.

Fix:
Simply compute the relative url from the paginated url instead of the not paginated one.