Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
New: Add Ethical Ads (#766)
Browse files Browse the repository at this point in the history
* New: Add Ethical Ads

* Fix ad on homepage and demo

* Fix about pages
  • Loading branch information
nzakas authored Aug 17, 2020
1 parent 3a4f35d commit 957eea4
Show file tree
Hide file tree
Showing 14 changed files with 100 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _data/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
title: "ESLint - Pluggable JavaScript linter",
description: "A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.",
banner: {
text: "<a href='https://code2040-2020.funraise.org/' style='color: #a486df'>Donate to Code2040</a>",
text: null,
foregroundColor: "#ffffff",
backgroundColor: "#150b29"
},
Expand Down
9 changes: 9 additions & 0 deletions _includes/ad.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- Ethical Ads -->
<div class="bordered" data-ea-publisher="eslint-org" data-ea-type="image">
<div class="eslint-ad eslint-image-ad">
<div class="eslint-ad-content">
<a href="https://opencollective.com/eslint" rel="nofollow" target="_blank"><img src="/assets/img/logo.svg"></a>
<div class="eslint-ad-text"><a href="http://opencollective.com/eslint" rel="nofollow" target="_blank"><strong>Sponsor ESLint.</strong> ESLint depends on donations for ongoing maintenance and development.</a></div>
</div>
</div>
</div>
1 change: 1 addition & 0 deletions _includes/head.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@
<link rel="icon" href="/assets/img/favicon.512x512.png">
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="/feed.xml">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css">
<script async src="https://media.ethicalads.io/media/client/ethicalads.min.js"></script>
</head>
6 changes: 6 additions & 0 deletions _includes/jumbotron.liquid
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<div class="jumbotron section-intro">
<div class="container i2">
<div class="eslint-ad-float hidden-xs hidden-sm">
<div class="bordered dark" data-ea-publisher="eslint-org" data-ea-type="image">
<!-- no fallback for jumbotron -->
</div>
</div>

<h1 itemprop="name">ESLint</h1>
<h2 itemprop="description">Find and fix problems in your JavaScript code</h2>
<a class="btn btn-default btn-lg" href="/docs/user-guide/getting-started">Get Started »</a>
Expand Down
8 changes: 8 additions & 0 deletions _includes/text-ad.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- Ethical Ads -->
<div class="bordered" data-ea-publisher="eslint-org" data-ea-type="text">
<div class="eslint-ad">
<div class="eslint-ad-content">
<a href="https://opencollective.com/eslint" rel="nofollow" target="_blank"><strong>Sponsor ESLint.</strong> ESLint depends on donations for ongoing maintenance and development.</a>
</div>
</div>
</div>
7 changes: 7 additions & 0 deletions _layouts/doc.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
{% include menu %}
<main class="doc">
<article class="container">
{% if ad == "text" %}
{% include text-ad %}
{% else %}
<div class="eslint-ad-float hidden-xs hidden-sm">
{% include ad %}
</div>
{% endif %}
{{ content
| replace: '<p>Examples of <strong>incorrect</strong> code', '<p class="incorrect icon">Examples of <strong>incorrect</strong> code'
| replace: '<p>Example of <strong>incorrect</strong> code', '<p class="incorrect icon">Example of <strong>incorrect</strong> code'
Expand Down
1 change: 1 addition & 0 deletions _layouts/post.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
</main>
</div>
<div class="col-md-4 hidden-xs hidden-sm">
{%include ad %}
<h2>Recent Posts</h2>
<ul class="posts">
{% for post in collections.posts limit: 25 %}
Expand Down
4 changes: 4 additions & 0 deletions _layouts/rule.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
{% include menu %}
<main class="rule doc">
<article class="container">
<div class="eslint-ad-float hidden-xs hidden-sm">
{%include ad %}
</div>

{{ content
| replace: '<p>Examples of <strong>incorrect</strong> code', '<p class="incorrect icon">Examples of <strong>incorrect</strong> code'
| replace: '<p>Example of <strong>incorrect</strong> code', '<p class="incorrect icon">Example of <strong>incorrect</strong> code'
Expand Down
4 changes: 4 additions & 0 deletions _layouts/rules.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
{% include menu %}
<main class="rules doc">
<article class="container">
<div class="eslint-ad-float hidden-xs hidden-sm">
{%include ad %}
</div>

{{ content
| replace: '(recommended)', '<span title="recommended" aria-label="recommended" class="glyphicon glyphicon-ok"></span>'
| replace: '(fixable)', '<span title="fixable" aria-label="fixable" class="glyphicon glyphicon-wrench"></span>'
Expand Down
2 changes: 1 addition & 1 deletion _pages/demo.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: ESLint Demo
layout: demo
---

{% include text-ad %}
<div id="app">
<div class="loading-demo-message">
Loading...
Expand Down
1 change: 1 addition & 0 deletions _pages/team.liquid
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Team
layout: doc
ad: text
---

<h1>Team</h1>
Expand Down
1 change: 1 addition & 0 deletions _pages/users.liquid
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "Who's Using ESLint?"
layout: doc
ad: text
---

<h1>Who's Using ESLint?</h1>
Expand Down
55 changes: 55 additions & 0 deletions src/styles/lib/ad.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.eslint-ad {

color: #333;
font-size: 14px;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
font-weight: normal;
font-style: normal;
letter-spacing: 0px;
vertical-align: baseline;
line-height: 1.3em;

border: 1px solid rgba(0,0,0,0.04);
border-radius: 3px;
box-shadow: none;

overflow: auto;

margin: 1em 1em 0.5em 1em;
padding: 1em;
background: rgba(0,0,0,0.03);
color: #505050;

.eslint-ad-content {
text-align: center;
}

img {
display: inline-block;
vertical-align: middle;
width: 120px;
height: 90px;
}

.eslint-ad-text {
font-size: 1em;
margin-top: 1em;
text-align: center;

a {
color: #505050;
text-decoration: none;
}
}



}

.eslint-image-ad {
max-width: 180px;
}

.eslint-ad-float {
float: right;
}
1 change: 1 addition & 0 deletions src/styles/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
@import "lib/rules_index.less";
@import "lib/404.less";
@import "lib/banner.less";
@import "lib/ad.less";

0 comments on commit 957eea4

Please sign in to comment.