Skip to content
This repository was archived by the owner on Mar 20, 2025. It is now read-only.

Commit 52742f7

Browse files
Ned Batcheldernedbat
Ned Batchelder
authored andcommitted
fix: inter-book references need to be sensitive to the version of the book
A reference in the glossary was changed on master after maple, and now maple builds fail because the reference goes to /latest/ rather than /maple/. This variable will let us change Maple to refer to other maple books.
1 parent 98bc1f6 commit 52742f7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

shared/conf.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77

88
import edx_theme
99

10+
# What release line is this? Use "master" for master, and the release name
11+
# on release branches. Zebrawood should have "zebrawood".
12+
release_line = "master"
13+
14+
# The slug that is used by ReadTheDocs for this version of the projects.
15+
project_version = "latest" if (release_line == "master") else f"open-release-master.{release_line}"
16+
1017
# on_rtd is whether we are on readthedocs.io, this line of code grabbed from docs.readthedocs.io
1118
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
1219

@@ -158,7 +165,7 @@ def feedback_form_url(project, page):
158165

159166
def edx_rtd_url(slug):
160167
"""Use this with the readthedoc project slug to create the full URL."""
161-
return f"https://edx.readthedocs.io/projects/{slug}/en/latest/"
168+
return f"https://edx.readthedocs.io/projects/{slug}/en/{project_version}/"
162169

163170
def ism_location(dir_name):
164171
"""Calculate the intersphinx_mapping location to use for a book.
@@ -195,4 +202,3 @@ def ism_location(dir_name):
195202
# :jira:`TNL-4904` becomes: <a href='https://openedx.atlassian.net/browse/TNL-4904'>TNL-4904</a>
196203
'jira': ('https://openedx.atlassian.net/browse/%s', ''),
197204
}
198-

0 commit comments

Comments
 (0)