File tree 2 files changed +19
-9
lines changed
2 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -113,16 +113,22 @@ def get_config_params(self):
113
113
114
114
# Avoid hitting database and API if using Docker build environment
115
115
if settings .DONT_HIT_API :
116
- versions = self .project .active_versions ().filter (
117
- privacy_level = PUBLIC ,
118
- )
116
+ if self .project .has_feature (Feature .ALL_VERSIONS_IN_HTML_CONTEXT ):
117
+ versions = self .project .active_versions ()
118
+ else :
119
+ versions = self .project .active_versions ().filter (
120
+ privacy_level = PUBLIC ,
121
+ )
119
122
downloads = self .version .get_downloads (pretty = True )
120
123
else :
121
- versions = [
122
- v
123
- for v in self .project .api_versions ()
124
- if v .privacy_level == PUBLIC
125
- ]
124
+ if self .project .has_feature (Feature .ALL_VERSIONS_IN_HTML_CONTEXT ):
125
+ versions = self .project .api_versions ()
126
+ else :
127
+ versions = [
128
+ v
129
+ for v in self .project .api_versions ()
130
+ if v .privacy_level == PUBLIC
131
+ ]
126
132
downloads = api .version (self .version .pk ).get ()['downloads' ]
127
133
128
134
data = {
Original file line number Diff line number Diff line change @@ -1479,6 +1479,7 @@ def add_features(sender, **kwargs):
1479
1479
EXTERNAL_VERSION_BUILD = 'external_version_build'
1480
1480
UPDATE_CONDA_STARTUP = 'update_conda_startup'
1481
1481
CONDA_APPEND_CORE_REQUIREMENTS = 'conda_append_core_requirements'
1482
+ ALL_VERSIONS_IN_HTML_CONTEXT = 'all_versions_in_html_context'
1482
1483
1483
1484
FEATURES = (
1484
1485
(USE_SPHINX_LATEST , _ ('Use latest version of Sphinx' )),
@@ -1530,7 +1531,10 @@ def add_features(sender, **kwargs):
1530
1531
CONDA_APPEND_CORE_REQUIREMENTS ,
1531
1532
_ ('Append Read the Docs core requirements to environment.yml file' ),
1532
1533
),
1533
-
1534
+ (
1535
+ ALL_VERSIONS_IN_HTML_CONTEXT ,
1536
+ _ ('Pass all versions (including private) into the html context when building with Sphinx' ),
1537
+ ),
1534
1538
)
1535
1539
1536
1540
projects = models .ManyToManyField (
You can’t perform that action at this time.
0 commit comments