Skip to content

Commit e5facfe

Browse files
committed
Merge remote-tracking branch 'davidfischer/use-sustainability-api'
2 parents 8f2d59c + 3a67d11 commit e5facfe

21 files changed

+939
-3024
lines changed

media/css/readthedocs-doc-embed.css

+48-115
Original file line numberDiff line numberDiff line change
@@ -42,144 +42,77 @@ To support sphinx_rtd_theme, a `wy-menu` element is added. Other themes are
4242
targeted using the theme identifier and use custom elements instead of a CSS
4343
framework html structure.
4444
45-
div.rst-pro is deprecated in favor of div.rtd-pro here, though we still need
46-
both rules for historical docs.
4745
*/
4846

49-
div.rtd-pro,
50-
div.rst-pro {
51-
display: block;
52-
padding: .5em;
53-
margin: 1em 0em 1em 0em;
54-
text-align: center;
47+
div.ethical-sidebar, div.ethical-footer {
48+
display: block !important;
5549
}
56-
div.rtd-pro.wy-menu,
57-
div.rtd-pro.wy-menu {
58-
width: 300px;
59-
}
60-
div.rtd-pro.alabaster {
61-
width: 100%;
62-
box-sizing: border-box;
63-
}
64-
65-
div.rtd-pro.wy-menu,
66-
div.rst-pro.wy-menu {
67-
bottom: 60px;
68-
background: rgba(0, 0, 0, .06);
69-
}
70-
71-
div.rtd-pro.alabaster {
72-
background: rgba(220, 220, 220, .1);
73-
}
74-
75-
div.rtd-pro > span,
76-
div.rst-pro > span {
77-
display: block;
78-
font-size: 90%;
79-
}
80-
81-
div.rtd-pro.wy-menu > span,
82-
div.rst-pro.wy-menu > span {
83-
color: #b3b3b3;
84-
}
85-
86-
div.rtd-pro.wy-menu a,
87-
div.rtd-pro.wy-menu a:link,
88-
div.rtd-pro.wy-menu a:visited,
89-
div.rst-pro.wy-menu a,
90-
div.rst-pro.wy-menu a:link,
91-
div.rst-pro.wy-menu a:visited,
92-
div.rtd-pro.wy-menu a:hover,
93-
div.rtd-pro.wy-menu a:active,
94-
div.rst-pro.wy-menu a:hover,
95-
div.rst-pro.wy-menu a:active { color: #efefef; }
96-
97-
div.rtd-pro a.rtd-pro-image-wrapper {
98-
display: inline-block;
99-
padding: 6px;
100-
margin: 5px 0px 10px 0px;
101-
border: 1px solid #434343;
102-
border-radius: 3px;
103-
-moz-border-radius: 3px;
104-
-webkit-border-radius: 3px;
105-
}
106-
107-
div.rtd-pro.wy-menu a.rtd-pro-image-wrapper,
108-
div.rst-pro.wy-menu a.rst-pro-image-wrapper {
109-
border-color: #434343;
110-
}
111-
112-
div.rtd-pro.alabaster a.rtd-pro-image-wrapper {
113-
border-color: #d3d3d3;
50+
.ethical-sidebar, .ethical-footer {
51+
padding: .5em;
52+
margin: 1em 0;
11453
}
115-
116-
div.rtd-pro img,
117-
div.rst-pro.wy-menu img {
54+
.ethical-sidebar img, .ethical-footer img {
11855
width: 120px;
11956
height: 90px;
57+
display: inline-block;
12058
}
121-
122-
div.rtd-pro div.rtd-pro-about {
123-
float: right;
124-
text-align: right;
125-
font-size: 90%;
59+
.ethical-sidebar .ethical-callout, .ethical-footer .ethical-callout {
60+
padding-top: 1em;
61+
clear: both;
12662
}
127-
div.rtd-pro.wy-menu div.rtd-pro-about,
128-
div.rst-pro.wy-menu div.rst-pro-about {
129-
color: white;
63+
.ethical-sidebar .ethical-pixel, .ethical-footer .ethical-pixel {
64+
display: none !important;
13065
}
131-
132-
div.rtd-pro.alabaster div.rtd-pro-about a {
133-
border-bottom: 0px;
66+
.ethical-sidebar .ethical-text, .ethical-footer .ethical-text {
67+
margin-top: 1em;
13468
}
135-
136-
div.rtd-pro.alabaster div.rtd-pro-about i.fa-info-circle:before,
137-
div.rtd-pro.rtd-pro-footer div.rtd-pro-about i.fa-info-circle:before {
138-
content: "";
139-
color: #a3a3a3;
69+
.ethical-sidebar .ethical-image-link, .ethical-footer .ethical-image-link {
70+
border: 0;
14071
}
14172

142-
/* Hide the "sponsored" note in the left navigation */
143-
div.rtd-pro-about span {
144-
display: none;
73+
/* Sidebar promotions */
74+
.ethical-sidebar {
75+
text-align: center;
14576
}
14677

147-
/* Footer promos */
148-
div.rtd-pro.rtd-pro-footer div.rtd-pro-about span {
149-
display: inline;
150-
}
151-
div.rtd-pro.rtd-pro-footer div.rtd-pro-about {
152-
float: none;
153-
}
154-
div.rtd-pro.rtd-pro-footer div.rtd-pro-about a {
155-
text-decoration: none;
156-
}
157-
div.rtd-pro.rtd-pro-footer {
78+
/* Footer promotions */
79+
.ethical-footer {
15880
text-align: left;
81+
font-size: 90%;
15982
}
160-
div.rtd-pro.rtd-pro-footer a.rtd-pro-image-wrapper {
83+
.ethical-footer img {
16184
float: right;
16285
margin-left: 25px;
16386
}
164-
165-
div.rtd-pro-wrapper {
166-
clear: both;
87+
.ethical-footer .ethical-callout {
88+
text-align: right;
16789
}
16890

169-
@media (max-width: 768px) {
170-
div.rst-pro.wy-menu {
171-
display: none;
172-
}
91+
/* RTD Theme specific customizations */
92+
.ethical-rtd .ethical-sidebar {
93+
/* RTD theme doesn't set sidebar text color */
94+
color: #b3b3b3;
17395

174-
div.rtd-pro.alabaster {
175-
background: rgba(220, 220, 220, .05);
176-
}
96+
/* RTD theme doesn't correctly set the sidebar width */
97+
width: 300px;
17798

178-
div.rtd-pro.alabaster a.rtd-pro-image-wrapper {
179-
border-color: #656565;
180-
}
99+
font-size: 14px;
100+
line-height: 20px;
101+
}
102+
.ethical-rtd .ethical-sidebar a,
103+
.ethical-rtd .ethical-sidebar a:visited,
104+
.ethical-rtd .ethical-sidebar a:hover,
105+
.ethical-rtd .ethical-sidebar a:active {
106+
/* RTD theme doesn't set sidebar link color */
107+
color: #efefef;
181108
}
182109

183-
div.rtd-pro > p.ethical-callout {
184-
margin-top: 1em;
110+
/* Alabaster specific customizations */
111+
.ethical-alabaster a.ethical-image-link {
112+
/* Alabaster adds a border even to image links on hover */
113+
border: 0 !important;
114+
}
115+
.ethical-alabaster hr {
116+
/* Alabaster needs some extra spacing before the footer ad */
117+
margin-top: 2em;
185118
}

readthedocs/builds/static/builds/js/detail.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

readthedocs/core/static-src/core/js/doc-embed/constants.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
var exports = {
44
THEME_RTD: 'sphinx_rtd_theme',
55
THEME_ALABASTER: 'alabaster',
6-
THEME_CELERY: 'sphinx_celery'
7-
}
6+
THEME_CELERY: 'sphinx_celery',
7+
};
88

99
exports.PROMO_SUPPORTED_THEMES = [
1010
exports.THEME_RTD,
1111
exports.THEME_ALABASTER,
12-
exports.THEME_CELERY
13-
]
12+
exports.THEME_CELERY,
13+
];
1414

1515
exports.PROMO_TYPES = {
1616
LEFTNAV: 'doc', // Left navigation on documentation pages
17-
FOOTER: 'site-footer' // Footer of documentation pages
17+
FOOTER: 'site-footer', // Footer of documentation pages
1818
};
1919

2020
module.exports = exports;

readthedocs/core/static-src/core/js/doc-embed/footer.js

-28
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
var rtddata = require('./rtd-data');
22
var versionCompare = require('./version-compare');
3-
var sponsorship = require('../sponsorship');
43

54

65
function injectFooter(data) {
@@ -19,22 +18,6 @@ function injectFooter(data) {
1918
} else if (!data['version_supported']) {
2019
//$('.rst-current-version').addClass('rst-active-old-version')
2120
}
22-
23-
// Show promo selectively
24-
if (data.promo && config.show_promo()) {
25-
var promo = new sponsorship.Promo(
26-
data.promo_data.id,
27-
data.promo_data.text,
28-
data.promo_data.link,
29-
data.promo_data.image,
30-
config.theme,
31-
data.promo_data.display_type,
32-
data.promo_data.pixel
33-
)
34-
if (promo) {
35-
promo.display();
36-
}
37-
}
3821
}
3922

4023

@@ -53,7 +36,6 @@ function setupBookmarkCSRFToken() {
5336
});
5437
}
5538

56-
5739
function init() {
5840
var rtd = rtddata.get();
5941

@@ -79,15 +61,6 @@ function init() {
7961
get_data['subproject'] = true;
8062
}
8163

82-
if (typeof URL !== 'undefined' && typeof URLSearchParams !== 'undefined') {
83-
// Force a specific promo to be displayed
84-
var params = new URL(window.location).searchParams;
85-
var force_promo = params.get('promo');
86-
if (force_promo) {
87-
get_data['promo'] = force_promo;
88-
}
89-
}
90-
9164
// Get footer HTML from API and inject it into the page.
9265
$.ajax({
9366
url: rtd.api_host + "/api/v2/footer_html/",
@@ -108,7 +81,6 @@ function init() {
10881
});
10982
}
11083

111-
11284
module.exports = {
11385
init: init
11486
};

0 commit comments

Comments
 (0)