Add sponsorship ad for Twilio

front-end-standardization
Anthony Johnson 2015-05-05 00:29:05 -07:00
parent eeac9b6b16
commit be4ef194af
6 changed files with 152 additions and 96 deletions

View File

@ -9,14 +9,11 @@ supporting us.
Current sponsors
----------------
* `Twilio`_ - Twilio, a user of Read the Docs, is organizing `Signal`_, a
developer conference for communications, held May 19-20th.
* `Rackspace`_ - They cover all of our hosting expenses every month. This is a pretty large sum of money, and we are really grateful to have them as a sponsor.
* You? (Email us at hello@readthedocs.com for more info)
If you appreciate the service,
please consider helping support development on `Gratipay`_.
It helps provide support for development,
as well as ongoing monetary stability in case of sponsorship changes.
Past sponsors
-------------
@ -26,7 +23,6 @@ Past sponsors
* `Django Software Foundation`_
* Lab305_
.. _Gratipay: https://gratipay.com/readthedocs/
.. _Revsys: http://www.revsys.com/
.. _Python Software Foundation: http://python.org/psf/
.. _Mozilla Web Dev: http://blog.mozilla.com/webdev/
@ -34,6 +30,9 @@ Past sponsors
.. _Lab305: http://www.lab305.com/
.. _Rackspace: http://www.rackspace.com/
.. _Twilio: http://twilio.com/
.. _Signal: http://signal.twilio.com/
Sponsorship Information
-----------------------
@ -52,14 +51,21 @@ Doc Page Promotion
~~~~~~~~~~~~~~~~~~
This is our best offering,
and shows your logo on every documentation page with the Read the Docs or Alabaster theme.
it displays your logo and supporting text on every documentation page using the Read the Docs theme.
This covers over 10,000,000 pageviews every month.
Only *1* company has a Doc Page Promotion at a time.
Limit *1* company per month.
This promotion is not displayed for users with gold status, or users that have
donated in the past.
`Contact us`_ for more specifications on this promotion spot.
.. _`Contact us`: mailto:hello@readthedocs.com
Footer Logo Promotion
~~~~~~~~~~~~~~~~~~~~~
Footer Logo Promotion shows the logo of your company in our page footer.
It will be a rotation of all logos from companies that support us,
This promotion displays the name of your company in the footer of docuentation pages.
It is a rotation of all sponsors,
so will vary in pageviews based on the number of supporting companies.
We will never have more than *10* companies in this promotion at any time.

View File

@ -38,8 +38,9 @@ div.wy-menu.rst-pro {
width: 300px;
padding: .5em;
margin: 1em 0em 1em 0em;
text-align: center;
background: rgba(255, 255, 255, .06);
background: rgba(0, 0, 0, .06);
}
@media (max-width: 768px) {
@ -48,19 +49,36 @@ div.wy-menu.rst-pro {
}
}
div.wy-menu.rst-pro > span {
display: block;
color: #838383;
font-size: 90%;
}
div.wy-menu.rst-pro a,
div.wy-menu.rst-pro a:link,
div.wy-menu.rst-pro a:visited { color: #b3b3b3; }
div.wy-menu.rst-pro a:hover,
div.wy-menu.rst-pro a:active { color: #c3c3c3; }
div.wy-menu.rst-pro a.rst-pro-link {
display: block;
text-align: center;
font-size: 90%;
div.wy-menu.rst-pro a.rst-pro-image-wrapper {
display: inline-block;
padding: 6px;
margin: 5px 0px 10px 0px;
border: 1px solid #434343;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
div.wy-menu.rst-pro img {
width: 120px;
height: 90px;
}
div.wy-menu.rst-pro div.rst-pro-about {
float: right;
text-align: right;
color: white;
font-size: 90%;

View File

@ -24,9 +24,12 @@ Build.prototype.is_rtd_theme = function () {
return (this.config['theme'] == 'sphinx_rtd_theme');
};
Build.prototype.show_promo = function () {
// Turn off until the UI is fixed
return false;
// TODO don't do this.
// return (this.config['api_host'] != 'https://readthedocs.com');
Build.prototype.is_sphinx_builder = function () {
return (!('builder' in this.config) || this.config['builder'] != 'mkdocs');
};
Build.prototype.show_promo = function () {
return (this.config['api_host'] != 'https://readthedocs.com'
&& this.is_sphinx_builder()
&& this.is_rtd_theme());
};

View File

@ -57,6 +57,20 @@ $(document).ready(function () {
//$('.rst-current-version').addClass('rst-active-old-version')
}
// Show promo selectively
if (data.promo && build.show_promo()) {
// TODO don't hardcode this promo
var promo = sponsorship.Promo.from_variants([
{
id: 'twilio-signal',
text: 'Twilio presents <a>Signal</a> - Developer Conference for Communications',
link: 'https://signal.twilio.com/?utm_medium=banner&utm_source=readthedocs&utm_campaign=signal_ads_1',
image: '//fe8b662c5498dd80a666-7c4f8fef8f0aad53b9488757bc3dab78.r8.cf5.rackcdn.com/signal.png'
}
]);
promo.display();
}
// using jQuery
function getCookie(name) {
var cookieValue = null;
@ -194,24 +208,6 @@ $(document).ready(function () {
link.prepend(expand);
});
// Promos
// TODO don't hardcode this promo and remove the util function to hide the
// ad
var promo = null;
if (build.is_rtd_theme() && build.show_promo()) {
var promo = sponsorship.Promo.from_variants([
{
id: 'wtdna2015-v1',
text: 'Come join us at Write the Docs, a community conference about documentation.',
link: 'http://writethedocs.org/conf/na/2015/'
}
//'Enjoy reading the docs? Join fellow developers and tech writers at Write the Docs!',
//'Love docs as much as we do? Come join the community at the Write The Docs conference',
//'Tickets are now on sale for Write the Docs, a community conference about documentation!',
]);
promo.display();
}
// Sphinx theme state
window.SphinxRtdTheme = (function (jquery) {
var stickyNav = (function () {

View File

@ -6,9 +6,10 @@ module.exports = {
Promo: Promo
};
function Promo (text, link) {
function Promo (text, link, image) {
this.text = text;
this.link = link;
this.image = image;
this.promo = null;
}
@ -21,22 +22,6 @@ Promo.prototype.create = function () {
promo = $('<div />')
.attr('class', 'wy-menu rst-pro');
// Create link with callback
var promo_link = $('<a />')
.attr('class', 'rst-pro-link')
.attr('href', this.link)
.attr('target', '_blank')
.on('click', function (ev) {
if (_gaq) {
_gaq.push(
['rtfd._setAccount', 'UA-17997319-1'],
['rtfd._trackEvent', 'Promo', 'Click', self.variant]
);
}
})
.html(this.text)
.appendTo(promo);
// Promo info
var promo_about = $('<div />')
.attr('class', 'rst-pro-about');
@ -48,6 +33,37 @@ Promo.prototype.create = function () {
.appendTo(promo_about_link);
promo_about.appendTo(promo);
// Promo image
if (self.image) {
var promo_image_link = $('<a />')
.attr('class', 'rst-pro-image-wrapper')
.attr('href', this.link);
var promo_image = $('<img />')
.attr('class', 'rst-pro-image')
.attr('src', this.image)
.appendTo(promo_image_link);
promo.append(promo_image_link);
}
// Create link with callback
var promo_text = $('<span />')
.html(this.text);
$(promo_text).find('a').each(function () {
$(this)
.attr('class', 'rst-pro-link')
.attr('href', this.link)
.attr('target', '_blank')
.on('click', function (ev) {
if (_gaq) {
_gaq.push(
['rtfd._setAccount', 'UA-17997319-1'],
['rtfd._trackEvent', 'Promo', 'Click', self.variant]
);
}
})
});
promo.append(promo_text);
promo.appendTo(nav_side);
promo.wrapper = $('<div />')
@ -78,8 +94,9 @@ Promo.from_variants = function (variants) {
variant = variants[chosen],
text = variant.text,
link = variant.link,
image = variant.image,
id = variant.id,
promo = new Promo(text, link);
promo = new Promo(text, link, image);
promo.variant = id
return promo;
};

View File

@ -25,11 +25,14 @@ Build.prototype.is_rtd_theme = function () {
return (this.config['theme'] == 'sphinx_rtd_theme');
};
Build.prototype.is_sphinx_builder = function () {
return (!('builder' in this.config) || this.config['builder'] != 'mkdocs');
};
Build.prototype.show_promo = function () {
// Turn off until the UI is fixed
return false;
// TODO don't do this.
// return (this.config['api_host'] != 'https://readthedocs.com');
return (this.config['api_host'] != 'https://readthedocs.com'
&& this.is_sphinx_builder()
&& this.is_rtd_theme());
};
},{}],2:[function(require,module,exports){
@ -92,6 +95,20 @@ $(document).ready(function () {
//$('.rst-current-version').addClass('rst-active-old-version')
}
// Show promo selectively
if (data.promo && build.show_promo()) {
// TODO don't hardcode this promo
var promo = sponsorship.Promo.from_variants([
{
id: 'twilio-signal',
text: 'Twilio presents <a>Signal</a> - Developer Conference for Communications',
link: 'https://signal.twilio.com/?utm_medium=banner&utm_source=readthedocs&utm_campaign=signal_ads_1',
image: '//fe8b662c5498dd80a666-7c4f8fef8f0aad53b9488757bc3dab78.r8.cf5.rackcdn.com/signal.png'
}
]);
promo.display();
}
// using jQuery
function getCookie(name) {
var cookieValue = null;
@ -229,24 +246,6 @@ $(document).ready(function () {
link.prepend(expand);
});
// Promos
// TODO don't hardcode this promo and remove the util function to hide the
// ad
var promo = null;
if (build.is_rtd_theme() && build.show_promo()) {
var promo = sponsorship.Promo.from_variants([
{
id: 'wtdna2015-v1',
text: 'Come join us at Write the Docs, a community conference about documentation.',
link: 'http://writethedocs.org/conf/na/2015/'
}
//'Enjoy reading the docs? Join fellow developers and tech writers at Write the Docs!',
//'Love docs as much as we do? Come join the community at the Write The Docs conference',
//'Tickets are now on sale for Write the Docs, a community conference about documentation!',
]);
promo.display();
}
// Sphinx theme state
window.SphinxRtdTheme = (function (jquery) {
var stickyNav = (function () {
@ -586,9 +585,10 @@ module.exports = {
Promo: Promo
};
function Promo (text, link) {
function Promo (text, link, image) {
this.text = text;
this.link = link;
this.image = image;
this.promo = null;
}
@ -601,22 +601,6 @@ Promo.prototype.create = function () {
promo = $('<div />')
.attr('class', 'wy-menu rst-pro');
// Create link with callback
var promo_link = $('<a />')
.attr('class', 'rst-pro-link')
.attr('href', this.link)
.attr('target', '_blank')
.on('click', function (ev) {
if (_gaq) {
_gaq.push(
['rtfd._setAccount', 'UA-17997319-1'],
['rtfd._trackEvent', 'Promo', 'Click', self.variant]
);
}
})
.html(this.text)
.appendTo(promo);
// Promo info
var promo_about = $('<div />')
.attr('class', 'rst-pro-about');
@ -628,6 +612,37 @@ Promo.prototype.create = function () {
.appendTo(promo_about_link);
promo_about.appendTo(promo);
// Promo image
if (self.image) {
var promo_image_link = $('<a />')
.attr('class', 'rst-pro-image-wrapper')
.attr('href', this.link);
var promo_image = $('<img />')
.attr('class', 'rst-pro-image')
.attr('src', this.image)
.appendTo(promo_image_link);
promo.append(promo_image_link);
}
// Create link with callback
var promo_text = $('<span />')
.html(this.text);
$(promo_text).find('a').each(function () {
$(this)
.attr('class', 'rst-pro-link')
.attr('href', this.link)
.attr('target', '_blank')
.on('click', function (ev) {
if (_gaq) {
_gaq.push(
['rtfd._setAccount', 'UA-17997319-1'],
['rtfd._trackEvent', 'Promo', 'Click', self.variant]
);
}
})
});
promo.append(promo_text);
promo.appendTo(nav_side);
promo.wrapper = $('<div />')
@ -658,8 +673,9 @@ Promo.from_variants = function (variants) {
variant = variants[chosen],
text = variant.text,
link = variant.link,
image = variant.image,
id = variant.id,
promo = new Promo(text, link);
promo = new Promo(text, link, image);
promo.variant = id
return promo;
};