diff options
author | Hugo van Kemenade <hugovk@users.noreply.github.com> | 2023-04-30 05:02:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-30 05:02:03 (GMT) |
commit | accb417c338630ac6e836a5c811a89d54a3cd1d3 (patch) | |
tree | 181825532650a6d4a8b1775f436468e3fd6f564f /Doc | |
parent | 4b10ecc29f6ae69e599a5475a62d8e96a8711f90 (diff) | |
download | cpython-accb417c338630ac6e836a5c811a89d54a3cd1d3.zip cpython-accb417c338630ac6e836a5c811a89d54a3cd1d3.tar.gz cpython-accb417c338630ac6e836a5c811a89d54a3cd1d3.tar.bz2 |
Replace Netlify with Read the Docs build previews (#103843)
Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/conf.py | 11 | ||||
-rw-r--r-- | Doc/tools/templates/layout.html | 5 |
2 files changed, 6 insertions, 10 deletions
diff --git a/Doc/conf.py b/Doc/conf.py index 42c23bf..cef2a0e 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -114,12 +114,13 @@ if any('htmlhelp' in arg for arg in sys.argv): # Short title used e.g. for <title> HTML tags. html_short_title = '%s Documentation' % release -# Deployment preview information, from Netlify -# (See netlify.toml and https://docs.netlify.com/configure-builds/environment-variables/#git-metadata) +# Deployment preview information +# (See .readthedocs.yml and https://docs.readthedocs.io/en/stable/reference/environment-variables.html) +repository_url = os.getenv("READTHEDOCS_GIT_CLONE_URL") html_context = { - "is_deployment_preview": os.getenv("IS_DEPLOYMENT_PREVIEW"), - "repository_url": os.getenv("REPOSITORY_URL"), - "pr_id": os.getenv("REVIEW_ID") + "is_deployment_preview": os.getenv("READTHEDOCS_VERSION_TYPE") == "external", + "repository_url": repository_url.removesuffix(".git") if repository_url else None, + "pr_id": os.getenv("READTHEDOCS_VERSION") } # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, diff --git a/Doc/tools/templates/layout.html b/Doc/tools/templates/layout.html index 460161c..b91f813 100644 --- a/Doc/tools/templates/layout.html +++ b/Doc/tools/templates/layout.html @@ -11,11 +11,6 @@ {%- if is_deployment_preview %} <div id="deployment-preview-warning" style="padding: .5em; text-align: center; background-color: #fff2ba; color: #6a580e;"> - <div style="float: right; margin-top: -10px; margin-left: 10px;"> - <a href="https://www.netlify.com"> - <img src="https://www.netlify.com/img/global/badges/netlify-color-accent.svg" alt="Deploys by Netlify" /> - </a> - </div> {% trans %}This is a deploy preview created from a <a href="{{ repository_url }}/pull/{{ pr_id }}">pull request</a>. For authoritative documentation, see the {% endtrans %} <a href="https://docs.python.org/3/{{ pagename }}{{ file_suffix }}">{% trans %} the current stable release{% endtrans %}</a>. |