Skip to content

Commit 043ef80

Browse files
authored
Merge pull request #8823 from readthedocs/davidfischer/add-rtd-theme-projects
2 parents ba0c388 + e4c87be commit 043ef80

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ function inject_ads_client() {
2929
function create_ad_placement() {
3030
var selector = null;
3131
var class_name; // Used for theme specific CSS customizations
32+
var style_name;
33+
var ad_type = "readthedocs-sidebar";
3234
var element;
3335
var offset;
3436

@@ -51,7 +53,13 @@ function create_ad_placement() {
5153
class_name = 'ethical-rtd ethical-dark-theme';
5254
} else if (rtd.is_rtd_like_theme()) {
5355
selector = 'nav.wy-nav-side > div.wy-side-scroll';
54-
class_name = 'ethical-rtd ethical-dark-theme';
56+
if (Math.random() <= 0.1) {
57+
// Use the stickybox placement 10% of the time during rollout
58+
style_name = 'stickybox';
59+
ad_type = 'image';
60+
} else {
61+
class_name = 'ethical-rtd ethical-dark-theme';
62+
}
5563
} else if (rtd.is_alabaster_like_theme()) {
5664
selector = 'div.sphinxsidebar > div.sphinxsidebarwrapper';
5765
class_name = 'ethical-alabaster';
@@ -78,8 +86,9 @@ function create_ad_placement() {
7886
return $('<div />')
7987
.attr("id", "rtd-sidebar")
8088
.attr("data-ea-publisher", "readthedocs")
81-
.attr("data-ea-type", "readthedocs-sidebar")
89+
.attr("data-ea-type", ad_type)
8290
.attr("data-ea-manual", "true")
91+
.attr("data-ea-style", style_name)
8392
.addClass(class_name)
8493
.appendTo(selector);
8594
}

0 commit comments

Comments
 (0)