diff --git a/conf.py b/conf.py index c71af5c6b..abb0a508a 100644 --- a/conf.py +++ b/conf.py @@ -401,6 +401,8 @@ def localize(app, pagename, templatename, context, doctree): def _build_url(root, branch, pagename): + if not branch: + root = root.rstrip('/') return "{canonical_url}{canonical_branch}/{canonical_page}".format( canonical_url=root, canonical_branch=branch,