Skip to content

Commit

Permalink
Implement #132 and #143
Browse files Browse the repository at this point in the history
With a bunch of custom changes, see stream of consciousness
commentary in #143.
  • Loading branch information
bitprophet committed Oct 3, 2018
1 parent 098d5e9 commit a6af1a5
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 1 deletion.
23 changes: 22 additions & 1 deletion alabaster/donate.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
{# TODO: wrap all these in their own divs for easier styling #}

{% if theme_donate_url or theme_opencollective or theme_tidelift_url %}
<h3 class="donation">Donate/support</h3>
{% endif %}

{% if theme_donate_url %}
<p>
<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>
</p>
{% endif %}

{% if theme_opencollective %}
<p>
<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>
</p>
{% endif %}

{% if theme_tidelift_url %}
<h3>Professional support</h3>
<p>
Professionally-supported {{ project }} is available with the
<a href="{{ theme_tidelift_url }}">Tidelift Subscription</a>.
Expand Down
5 changes: 5 additions & 0 deletions alabaster/static/alabaster.css_t
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ div.sphinxsidebar .badge:hover {
border-bottom: none;
}

/* To address an issue with donation coming after search */
div.sphinxsidebar h3.donation {
margin-top: 10px;
}

/* -- 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 @@ -10,6 +10,7 @@ canonical_url =
codecov_button = false
description =
description_font_style = normal
donate_url =
extra_nav_links =
fixed_sidebar = false
github_banner = false
Expand All @@ -23,6 +24,8 @@ gratipay_user =
logo =
logo_name = false
logo_text_align = left
opencollective =
opencollective_button_color = white
page_width = 940px
relbar_border =
show_powered_by = true
Expand Down
8 changes: 8 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ Changelog
</customization>` to break up the now rather long list of "variables and
feature toggles" into additional sections; includes alphabetizing those
lists, to make it a bit easier to find docs for a specific setting.
- :feature:`132 backported` (partially via :issue:`143`) Add a generic donation
badge/url option (visually powered by https://shields.io/) as well as a
service-specific donation option for `OpenCollective
<https://opencollective.com>`_.

We expect this to be followed-up on later with more service-specific options
for services like Patreon. Thanks to Melanie Crutchfield for the report and
Steven Loria for the initial patch.
- :bug:`128` Remove Gittip/Gratipay output from the ``donation.html`` sidebar
component, since the actual service has been insolvent since 2017. The
configuration options remain in place for the time being (to avoid breaking
Expand Down
3 changes: 3 additions & 0 deletions docs/customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ banners.
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``: URL to generic/arbitrary donation service; causes display of
a basic 'Donate' badge/shield (from https://shields.io) linking to the URL
given. Requires ``donation.html`` in your ``html_sidebars``.
* ``github_banner``: ``true`` or ``false`` - whether to apply a 'Fork me on
Github' banner in the top right corner of the page.

Expand Down

0 comments on commit a6af1a5

Please sign in to comment.