diff --git a/doc/_static/js/custom-icons.js b/doc/_static/js/custom-icons.js new file mode 100644 index 00000000000..60b3c3b9276 --- /dev/null +++ b/doc/_static/js/custom-icons.js @@ -0,0 +1,19 @@ +FontAwesome.library.add( + /** + * Custom icon definitions + * + * see https://pydata-sphinx-theme.readthedocs.io/en/latest/user_guide/header-links.html#svg-image-icons + */ + { + prefix: "fa-custom", + iconName: "opencollective", + icon: [ + 24, + 24, + [], + "e001", + // https://simpleicons.org/icons/opencollective.svg + "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", + ], + }, +); diff --git a/doc/_static/style.css b/doc/_static/style.css index 70735d9c3fb..16b96ae6c11 100644 --- a/doc/_static/style.css +++ b/doc/_static/style.css @@ -31,6 +31,8 @@ html[data-theme="light"] { --mne-color-github: #000; --mne-color-discourse: #d0232b; --mne-color-mastodon: #2F0C7A; + --mne-color-sponsor: #BF3989; /* from GH sponsor heart, via browser devtools */ + --mne-color-opencollective: #1F87FF; /* scraped from logo SVG */ /* code block copy button */ --copybtn-opacity: 0.75; /* card header bg color */ @@ -63,6 +65,8 @@ html[data-theme="dark"] { --mne-color-github: rgb(240, 246, 252); /* from their logo SVG */ --mne-color-discourse: #FFF9AE; /* from their logo SVG */ --mne-color-mastodon: #858AFA; /* www.joinmastodon.org/en/branding */ + --mne-color-sponsor: #DB61A2; /* from GH sponsor heart, via browser devtools */ + --mne-color-opencollective: #99CFFF; /* scraped from logo SVG */ /* code block copy button */ --copybtn-opacity: 0.25; /* card header bg color */ @@ -253,7 +257,7 @@ aside.footnote:last-child { } /* ******************************************************* navbar icon links */ -.navbar-icon-links svg.fa-square-github { +.navbar-icon-links svg.fa-github { color: var(--mne-color-github); } .navbar-icon-links svg.fa-discourse { @@ -265,6 +269,12 @@ aside.footnote:last-child { .navbar-icon-links svg.fa-mastodon { color: var(--mne-color-mastodon); } +.navbar-icon-links svg.fa-heart { + color: var(--mne-color-sponsor); +} +.navbar-icon-links svg.fa-opencollective { + color: var(--mne-color-opencollective); +} /* ************************************************************ nav elements */ /* topbar nav inactive */ diff --git a/doc/conf.py b/doc/conf.py index 39ee02a6d3d..b735b1d7fca 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -780,7 +780,7 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines): html_theme_options = { "icon_links": [ dict( - name="Discord", + name="Discord (office hours)", url="https://discord.gg/rKfvxTuATa", icon="fa-brands fa-discord fa-fw", ), @@ -791,14 +791,24 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines): attributes=dict(rel="me"), ), dict( - name="Forum", + name="Q&A Forum", url="https://mne.discourse.group/", icon="fa-brands fa-discourse fa-fw", ), dict( - name="GitHub", + name="Code Repository", url="https://github.com/mne-tools/mne-python", - icon="fa-brands fa-square-github fa-fw", + icon="fa-brands fa-github fa-fw", + ), + dict( + name="Sponsor us on GitHub", + url="https://github.com/sponsors/mne-tools", + icon="fa-regular fa-heart fa-fw", + ), + dict( + name="Donate via OpenCollective", + url="https://opencollective.com/mne-python", + icon="fa-custom fa-opencollective fa-fw", ), ], "icon_links_label": "External Links", # for screen reader @@ -840,6 +850,9 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines): html_css_files = [ "style.css", ] +html_js_files = [ + ("js/custom-icons.js", {"defer": "defer"}), +] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied