diff --git a/docs/conf.py b/docs/conf.py index 110652fd..44df6da4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +import os + from pkg_resources import DistributionNotFound, get_distribution try: @@ -8,6 +10,10 @@ except DistributionNotFound: __version__ = "unknown version" +# Support canonical URL +html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") +if os.environ.get("READTHEDOCS", "") == "True": + html_context = {"READTHEDOCS": True} # General stuff extensions = [