diff --git a/conf.py b/conf.py index f0ce00109..aded7d689 100644 --- a/conf.py +++ b/conf.py @@ -411,6 +411,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,