Skip to content

Commit a6af1a5

Browse files
committed
Implement #132 and #143
With a bunch of custom changes, see stream of consciousness commentary in #143.
1 parent 098d5e9 commit a6af1a5

File tree

5 files changed

+41
-1
lines changed

5 files changed

+41
-1
lines changed

alabaster/donate.html

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
1+
{# TODO: wrap all these in their own divs for easier styling #}
2+
3+
{% if theme_donate_url or theme_opencollective or theme_tidelift_url %}
4+
<h3 class="donation">Donate/support</h3>
5+
{% endif %}
6+
7+
{% if theme_donate_url %}
8+
<p>
9+
<a class="badge" href="{{ theme_donate_url }}">
10+
<img src="https://img.shields.io/badge/donate-%E2%9D%A4%C2%A0-ff69b4.svg?style=flat" alt="Donate">
11+
</a>
12+
</p>
13+
{% endif %}
14+
15+
{% if theme_opencollective %}
16+
<p>
17+
<a class="badge" href="https://opencollective.com/{{ theme_opencollective }}/donate" target="_blank">
18+
<img src="https://opencollective.com/{{ theme_opencollective }}/donate/button.png?color={{ theme_opencollective_button_color }}" width=300 />
19+
</a>
20+
</p>
21+
{% endif %}
22+
123
{% if theme_tidelift_url %}
2-
<h3>Professional support</h3>
324
<p>
425
Professionally-supported {{ project }} is available with the
526
<a href="{{ theme_tidelift_url }}">Tidelift Subscription</a>.

alabaster/static/alabaster.css_t

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,11 @@ div.sphinxsidebar .badge:hover {
229229
border-bottom: none;
230230
}
231231

232+
/* To address an issue with donation coming after search */
233+
div.sphinxsidebar h3.donation {
234+
margin-top: 10px;
235+
}
236+
232237
/* -- body styles ----------------------------------------------------------- */
233238

234239
a {

alabaster/theme.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ canonical_url =
1010
codecov_button = false
1111
description =
1212
description_font_style = normal
13+
donate_url =
1314
extra_nav_links =
1415
fixed_sidebar = false
1516
github_banner = false
@@ -23,6 +24,8 @@ gratipay_user =
2324
logo =
2425
logo_name = false
2526
logo_text_align = left
27+
opencollective =
28+
opencollective_button_color = white
2629
page_width = 940px
2730
relbar_border =
2831
show_powered_by = true

docs/changelog.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ Changelog
99
</customization>` to break up the now rather long list of "variables and
1010
feature toggles" into additional sections; includes alphabetizing those
1111
lists, to make it a bit easier to find docs for a specific setting.
12+
- :feature:`132 backported` (partially via :issue:`143`) Add a generic donation
13+
badge/url option (visually powered by https://shields.io/) as well as a
14+
service-specific donation option for `OpenCollective
15+
<https://opencollective.com>`_.
16+
17+
We expect this to be followed-up on later with more service-specific options
18+
for services like Patreon. Thanks to Melanie Crutchfield for the report and
19+
Steven Loria for the initial patch.
1220
- :bug:`128` Remove Gittip/Gratipay output from the ``donation.html`` sidebar
1321
component, since the actual service has been insolvent since 2017. The
1422
configuration options remain in place for the time being (to avoid breaking

docs/customization.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ banners.
116116
string - used to display a `Codecov <https://codecov.io>`_ build status
117117
button in the sidebar. If ``true``, uses your ``github_(user|repo)``
118118
settings.
119+
* ``donate_url``: URL to generic/arbitrary donation service; causes display of
120+
a basic 'Donate' badge/shield (from https://shields.io) linking to the URL
121+
given. Requires ``donation.html`` in your ``html_sidebars``.
119122
* ``github_banner``: ``true`` or ``false`` - whether to apply a 'Fork me on
120123
Github' banner in the top right corner of the page.
121124

0 commit comments

Comments
 (0)