Skip to content

Commit

Permalink
Set canonical custom domain URL for ReadTheDocs AddOns migration
Browse files Browse the repository at this point in the history
  • Loading branch information
sgibson91 committed Aug 27, 2024
1 parent d2b3320 commit f1e88d7
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
@@ -1,3 +1,4 @@
import os
from pathlib import Path
from subprocess import run

Expand Down Expand Up @@ -146,3 +147,15 @@ def setup(app):
nb_execution_timeout = -1 # no timeout
nb_execution_mode = 'auto'
suppress_warnings = ["mystnb.unknown_mime_type"]

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

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 f1e88d7

Please sign in to comment.