Skip to content

Commit

Permalink
Merge pull request #4695 from sgibson91/rtd-addons-migration
Browse files Browse the repository at this point in the history
ReadTheDocs: set canonical custom domain in prep for addons migration
  • Loading branch information
sgibson91 authored Aug 27, 2024
2 parents ac1e27d + d69cb0f commit 0fa5f55
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,23 @@ def setup(app):
app.add_css_file("custom.css")


html_context = {}

import os
import subprocess

# -- Custom scripts -----------------------------------------
subprocess.run(
["python", "helper-programs/generate-general-info-table-about-hubs.py"], check=True
)
subprocess.run(["python", "helper-programs/generate-hub-features-table.py"], check=True)

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

# 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 0fa5f55

Please sign in to comment.