Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Switch to Ethical Ads #18090

Merged
merged 4 commits into from Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions docs/src/_data/sites/en.yml
Expand Up @@ -26,9 +26,8 @@ google_analytics:
# Ads
#------------------------------------------------------------------------------

carbon_ads:
serve: CESDV2QM
placement: eslintorg
carbon_ads: false
harish-sethuraman marked this conversation as resolved.
Show resolved Hide resolved
ethical_ads: true

#------------------------------------------------------------------------------
# Shared
Expand Down
2 changes: 1 addition & 1 deletion docs/src/_includes/components/hero.macro.html
Expand Up @@ -22,7 +22,7 @@ <h1 class="section-title">{{ params.title }}</h1>
{% endif %}
</div>
<div class="span-10-12 hero-ad">
{% include "partials/carbon-ad.html" %}
{% include "partials/ads.html" %}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/_includes/layouts/doc.html
Expand Up @@ -111,7 +111,7 @@ <h1>{{ title }}</h1>
<div class="docs-aside">
<div class="docs-aside__content">
<aside class="docs-ad">
{%- include 'partials/carbon-ad.html' -%}
{%- include 'partials/ads.html' -%}
</aside>
{% include 'components/docs-toc.html' %}
</div>
Expand Down
harish-sethuraman marked this conversation as resolved.
Show resolved Hide resolved
Expand Up @@ -11,3 +11,15 @@
}
</script>
{% endif %}
{% if site.ethical_ads %}
<script id="eslint-sponsor">
if (window.innerWidth > 800) {
var s = document.createElement("script");
s.type = "text/javascript";
s.src = "//media.ethicalads.io/media/client/ethicalads.min.js";
document.getElementById("eslint-sponsor").after(s);
document.getElementById("eslint-sponsor").remove();
}
</script>
<div data-ea-publisher="eslint-org" data-ea-type="image"></div>
{% endif %}
Expand Up @@ -4,6 +4,15 @@
}
}

.docs-ad {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we had a wrapper in the main page to avoid shift of content when ad pops up. Seems like docs didn't have it so added this.

height: 290px;
}

/*
* Carbon Ads
* https://www.carbonads.net/
*/

#carbonads * {
margin: initial;
padding: initial;
Expand Down Expand Up @@ -113,3 +122,39 @@
font-size: 8px;
}
}

/*
* Ethical Ads
*/

[data-ea-publisher].loaded .ea-content,
[data-ea-type].loaded .ea-content {
background-color: var(--body-background-color) !important;
border: 1px solid var(--border-color) !important;
}

// [data-ea-publisher].loaded .ea-content a:hover,
// [data-ea-type].loaded .ea-content a:hover {
// text-decoration: none;
// color: var(--link-color);
// }
harish-sethuraman marked this conversation as resolved.
Show resolved Hide resolved

[data-ea-publisher].loaded .ea-content a:link,
[data-ea-type].loaded .ea-content a:link {
color: var(--body-text-color) !important;
}

[data-ea-publisher].loaded .ea-callout a:link,
[data-ea-type].loaded .ea-callout a:link {
color: var(--body-text-color) !important;
}

.jumbotron [data-ea-publisher].loaded .ea-content a,
.jumbotron [data-ea-type].loaded .ea-content a {
color: #eee;
}

.jumbotron [data-ea-publisher].loaded .ea-content a:hover,
.jumbotron [data-ea-type].loaded .ea-content a:hover {
color: #ccc;
}
2 changes: 1 addition & 1 deletion docs/src/assets/scss/styles.scss
Expand Up @@ -30,6 +30,6 @@
@import "components/tabs";
@import "components/resources";

@import "carbon-ads";
@import "ads";

@import "utilities";