Skip to content

Commit

Permalink
Merge pull request #243 from sgibson91/rtd-addons-migration
Browse files Browse the repository at this point in the history
Set canonical custom domain for ReadTheDocs AddOns migration
  • Loading branch information
sgibson91 authored Aug 27, 2024
2 parents a58a7e6 + d426827 commit b17adc2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,16 @@ def setup(app):
path_image.write_bytes(resp.content)
else:
print(f"Diagram image exists, delete this file to re-download: {path_image}")

# -- Set canonical custom domain via html_baseurl -----------
# -- See https://github.com/2i2c-org/infrastructure/issues/4629
import os

html_context = {}

# Set canonical URL from the Read the Docs Domain
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")

# Tell Jinja2 templates the build is running on Read the Docs
if os.environ.get("READTHEDOCS", "") == "True":
html_context["READTHEDOCS"] = True

0 comments on commit b17adc2

Please sign in to comment.