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

Add donate_url and opencollective options to add donate buttons to the sidebar #143

Closed
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions alabaster/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h1 class="logo"><a href="{{ pathto(master_doc) }}">{{ project }}</a></h1>
{% set path = theme_travis_button %}
{% endif %}
<p>
<a href="https://travis-ci.org/{{ path }}">
<a class="badge" href="https://travis-ci.org/{{ path }}">
<img
alt="https://secure.travis-ci.org/{{ path }}.svg?branch={{ theme_badge_branch }}"
src="https://secure.travis-ci.org/{{ path }}.svg?branch={{ theme_badge_branch }}"
Expand All @@ -47,7 +47,7 @@ <h1 class="logo"><a href="{{ pathto(master_doc) }}">{{ project }}</a></h1>
{% set path = theme_codecov_button %}
{% endif %}
<p>
<a href="https://codecov.io/github/{{ path }}">
<a class="badge" href="https://codecov.io/github/{{ path }}">
<img
alt="https://codecov.io/github/{{ path }}/coverage.svg?branch={{ theme_badge_branch }}"
src="https://codecov.io/github/{{ path }}/coverage.svg?branch={{ theme_badge_branch }}"
Expand Down
22 changes: 22 additions & 0 deletions alabaster/donate.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,25 @@ <h3>Donate</h3>
src="//gttp.co/v1.js"></script>
</p>
{% endif %}

{% if theme_donate_url or theme_opencollective %}
<h3>Donate</h3>

<p>If you find {{ project }} useful, please consider supporting the team with a donation:</p>

<p>

{% if theme_donate_url %}
<a class="badge" href="{{ theme_donate_url }}">
<img src="https://img.shields.io/badge/donate-%E2%9D%A4%C2%A0-ff69b4.svg?style=flat" alt="Donate">
</a>
{% endif %}
{% if theme_opencollective %}
<a class="badge" href="https://opencollective.com/{{ theme_opencollective }}/donate" target="_blank">
<img src="https://opencollective.com/{{ theme_opencollective }}/donate/button.png?color={{ theme_opencollective_button_color }}" width=300 />
</a>
{% endif %}
</p>

<p>Your donation keeps {{ project }} healthy and maintained.</p>
{% endif %}
8 changes: 8 additions & 0 deletions alabaster/static/alabaster.css_t
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,14 @@ div.sphinxsidebar hr {
width: 50%;
}

div.sphinxsidebar .badge {
border-bottom: none;
}

div.sphinxsidebar .badge:hover {
border-bottom: none;
}

Copy link
Contributor

@jab jab Oct 6, 2018

Choose a reason for hiding this comment

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

I think this whole commit (9c1fdac) is just working around the root cause, which I fixed in #125 almost a year ago but which still needs to be merged.

(I think the root cause is that some CSS in the theme that intends to clear the bottom border for all images is accidentally getting overridden by some CSS that comes after it.)

#125 has gotten 👍, but still has not been merged. Once it is merged, I think this workaround can be removed.

/cc @bitprophet @sloria

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @bitprophet, my previous comment is still the case, so I just thought I'd see if you might have a moment to merge my PR. Thanks for taking a look if you can!

Copy link
Contributor

Choose a reason for hiding this comment

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

(#125)

/* -- body styles ----------------------------------------------------------- */

a {
Expand Down
3 changes: 3 additions & 0 deletions alabaster/theme.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ github_count = true
badge_branch = master
travis_button = false
codecov_button = false
donate_url =
opencollective =
opencollective_button_color = white
gratipay_user =
gittip_user =
analytics_id =
Expand Down
7 changes: 7 additions & 0 deletions docs/customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ Variables and feature toggles
string - used to display a `Codecov <https://codecov.io>`_ build status
button in the sidebar. If ``true``, uses your ``github_(user|repo)``
settings.
* ``donate_url``: Set to the URL where you receive donations if you want
a 'Donate' section in your sidebar.
* ``opencollective``: Set to you `OpenCollective <https://opencollective.com/>`_
collective name if you want an OpenCollective 'Donate' section in your
sidebar.
* ``opencollective_button_color``: Set to the color for your "Donate To
Our Collective Button". May be ``"white"`` or ``"blue"``.
* ``gratipay_user``: Set to your `Gratipay <https://gratipay.com>`_ username
if you want a Gratipay 'Donate' section in your sidebar.

Expand Down