Skip to content

Commit c31ae1d

Browse files
authored
Add icon links to our donation pages (mne-tools#13331)
1 parent 4130e46 commit c31ae1d

File tree

3 files changed

+47
-5
lines changed

3 files changed

+47
-5
lines changed

doc/_static/js/custom-icons.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FontAwesome.library.add(
2+
/**
3+
* Custom icon definitions
4+
*
5+
* see https://pydata-sphinx-theme.readthedocs.io/en/latest/user_guide/header-links.html#svg-image-icons
6+
*/
7+
{
8+
prefix: "fa-custom",
9+
iconName: "opencollective",
10+
icon: [
11+
24,
12+
24,
13+
[],
14+
"e001",
15+
// https://simpleicons.org/icons/opencollective.svg
16+
"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12c2.54 0 4.894-.79 6.834-2.135l-3.107-3.109a7.715 7.715 0 1 1 0-13.512l3.107-3.109A11.943 11.943 0 0 0 12 0zm9.865 5.166l-3.109 3.107A7.67 7.67 0 0 1 19.715 12a7.682 7.682 0 0 1-.959 3.727l3.109 3.107A11.943 11.943 0 0 0 24 12c0-2.54-.79-4.894-2.135-6.834z",
17+
],
18+
},
19+
);

doc/_static/style.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ html[data-theme="light"] {
3131
--mne-color-github: #000;
3232
--mne-color-discourse: #d0232b;
3333
--mne-color-mastodon: #2F0C7A;
34+
--mne-color-sponsor: #BF3989; /* from GH sponsor heart, via browser devtools */
35+
--mne-color-opencollective: #1F87FF; /* scraped from logo SVG */
3436
/* code block copy button */
3537
--copybtn-opacity: 0.75;
3638
/* card header bg color */
@@ -63,6 +65,8 @@ html[data-theme="dark"] {
6365
--mne-color-github: rgb(240, 246, 252); /* from their logo SVG */
6466
--mne-color-discourse: #FFF9AE; /* from their logo SVG */
6567
--mne-color-mastodon: #858AFA; /* www.joinmastodon.org/en/branding */
68+
--mne-color-sponsor: #DB61A2; /* from GH sponsor heart, via browser devtools */
69+
--mne-color-opencollective: #99CFFF; /* scraped from logo SVG */
6670
/* code block copy button */
6771
--copybtn-opacity: 0.25;
6872
/* card header bg color */
@@ -253,7 +257,7 @@ aside.footnote:last-child {
253257
}
254258

255259
/* ******************************************************* navbar icon links */
256-
.navbar-icon-links svg.fa-square-github {
260+
.navbar-icon-links svg.fa-github {
257261
color: var(--mne-color-github);
258262
}
259263
.navbar-icon-links svg.fa-discourse {
@@ -265,6 +269,12 @@ aside.footnote:last-child {
265269
.navbar-icon-links svg.fa-mastodon {
266270
color: var(--mne-color-mastodon);
267271
}
272+
.navbar-icon-links svg.fa-heart {
273+
color: var(--mne-color-sponsor);
274+
}
275+
.navbar-icon-links svg.fa-opencollective {
276+
color: var(--mne-color-opencollective);
277+
}
268278

269279
/* ************************************************************ nav elements */
270280
/* topbar nav inactive */

doc/conf.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines):
780780
html_theme_options = {
781781
"icon_links": [
782782
dict(
783-
name="Discord",
783+
name="Discord (office hours)",
784784
url="https://discord.gg/rKfvxTuATa",
785785
icon="fa-brands fa-discord fa-fw",
786786
),
@@ -791,14 +791,24 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines):
791791
attributes=dict(rel="me"),
792792
),
793793
dict(
794-
name="Forum",
794+
name="Q&A Forum",
795795
url="https://mne.discourse.group/",
796796
icon="fa-brands fa-discourse fa-fw",
797797
),
798798
dict(
799-
name="GitHub",
799+
name="Code Repository",
800800
url="https://github.com/mne-tools/mne-python",
801-
icon="fa-brands fa-square-github fa-fw",
801+
icon="fa-brands fa-github fa-fw",
802+
),
803+
dict(
804+
name="Sponsor us on GitHub",
805+
url="https://github.com/sponsors/mne-tools",
806+
icon="fa-regular fa-heart fa-fw",
807+
),
808+
dict(
809+
name="Donate via OpenCollective",
810+
url="https://opencollective.com/mne-python",
811+
icon="fa-custom fa-opencollective fa-fw",
802812
),
803813
],
804814
"icon_links_label": "External Links", # for screen reader
@@ -840,6 +850,9 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines):
840850
html_css_files = [
841851
"style.css",
842852
]
853+
html_js_files = [
854+
("js/custom-icons.js", {"defer": "defer"}),
855+
]
843856

844857
# Add any extra paths that contain custom files (such as robots.txt or
845858
# .htaccess) here, relative to this directory. These files are copied

0 commit comments

Comments
 (0)