Skip to content

Commit

Permalink
Add donate_url and opencollective options
Browse files Browse the repository at this point in the history
When either are set, adds a "Donate" section to the sidebar.
If `donate_url` is set, a "donate" shield button is used.
If `opencollective` is set, an OpenCollective button is used.
  • Loading branch information
sloria committed Sep 6, 2018
1 parent 5f24967 commit 33cbf7d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
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 %}
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

0 comments on commit 33cbf7d

Please sign in to comment.