Skip to content

Commit 5b8c363

Browse files
docs: Switch to Ethical Ads (#18117)
(cherry picked from commit f1c7e6f) Co-authored-by: Strek <[email protected]>
1 parent 2196d97 commit 5b8c363

File tree

6 files changed

+57
-5
lines changed

6 files changed

+57
-5
lines changed

docs/src/_data/sites/en.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ google_analytics:
2727
#------------------------------------------------------------------------------
2828

2929
carbon_ads:
30-
serve: CESDV2QM
31-
placement: eslintorg
30+
serve: ""
31+
placement: ""
32+
ethical_ads: true
3233

3334
#------------------------------------------------------------------------------
3435
# Shared

docs/src/_includes/components/hero.macro.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h1 class="section-title">{{ params.title }}</h1>
2222
{% endif %}
2323
</div>
2424
<div class="span-10-12 hero-ad">
25-
{% include "partials/carbon-ad.html" %}
25+
{% include "partials/ad.html" %}
2626
</div>
2727
</div>
2828
</div>

docs/src/_includes/layouts/doc.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ <h1>{{ title }}</h1>
111111
<div class="docs-aside">
112112
<div class="docs-aside__content">
113113
<aside class="docs-ad">
114-
{%- include 'partials/carbon-ad.html' -%}
114+
{%- include 'partials/ad.html' -%}
115115
</aside>
116116
{% include 'components/docs-toc.html' %}
117117
</div>

docs/src/_includes/partials/carbon-ad.html docs/src/_includes/partials/ad.html

+12
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,15 @@
1111
}
1212
</script>
1313
{% endif %}
14+
{% if site.ethical_ads %}
15+
<script id="eslint-sponsor">
16+
if (window.innerWidth > 800) {
17+
var s = document.createElement("script");
18+
s.type = "text/javascript";
19+
s.src = "//media.ethicalads.io/media/client/ethicalads.min.js";
20+
document.getElementById("eslint-sponsor").after(s);
21+
document.getElementById("eslint-sponsor").remove();
22+
}
23+
</script>
24+
<div data-ea-publisher="eslint-org" data-ea-type="image"></div>
25+
{% endif %}

docs/src/assets/scss/carbon-ads.scss docs/src/assets/scss/ads.scss

+39
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
}
55
}
66

7+
.docs-ad {
8+
height: 290px;
9+
}
10+
11+
/*
12+
* Carbon Ads
13+
* https://www.carbonads.net/
14+
*/
15+
716
#carbonads * {
817
margin: initial;
918
padding: initial;
@@ -113,3 +122,33 @@
113122
font-size: 8px;
114123
}
115124
}
125+
126+
/*
127+
* Ethical Ads
128+
*/
129+
130+
[data-ea-publisher].loaded .ea-content,
131+
[data-ea-type].loaded .ea-content {
132+
background-color: var(--body-background-color) !important;
133+
border: 1px solid var(--border-color) !important;
134+
}
135+
136+
[data-ea-publisher].loaded .ea-content a:link,
137+
[data-ea-type].loaded .ea-content a:link {
138+
color: var(--body-text-color) !important;
139+
}
140+
141+
[data-ea-publisher].loaded .ea-callout a:link,
142+
[data-ea-type].loaded .ea-callout a:link {
143+
color: var(--body-text-color) !important;
144+
}
145+
146+
.jumbotron [data-ea-publisher].loaded .ea-content a,
147+
.jumbotron [data-ea-type].loaded .ea-content a {
148+
color: #eee;
149+
}
150+
151+
.jumbotron [data-ea-publisher].loaded .ea-content a:hover,
152+
.jumbotron [data-ea-type].loaded .ea-content a:hover {
153+
color: #ccc;
154+
}

docs/src/assets/scss/styles.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
@import "components/tabs";
3131
@import "components/resources";
3232

33-
@import "carbon-ads";
33+
@import "ads";
3434

3535
@import "utilities";

0 commit comments

Comments
 (0)