Skip to content

Commit 3d40411

Browse files
authored
Merge pull request #97 from dstansby/lh-sidebar
Improvements to LH sidebar layout
2 parents 7ec339a + 48e5fcd commit 3d40411

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

docs/conf.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3030
# ones.
3131
extensions = [
32-
'matplotlib.sphinxext.plot_directive',
32+
"matplotlib.sphinxext.plot_directive",
33+
"sphinx_design"
3334
]
3435

3536
# Add any paths that contain templates here, relative to this directory.
@@ -61,6 +62,12 @@
6162
"navbar_links": "absolute",
6263
}
6364

65+
html_sidebars = {
66+
"index": [
67+
"donate_sidebar.html",
68+
],
69+
}
70+
6471
# Add any paths that contain custom static files (such as style sheets) here,
6572
# relative to this directory. They are copied after the builtin static files,
6673
# so a file named "default.css" will overwrite the builtin "default.css".

mpl_sphinx_theme/donate_sidebar.html

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
2-
3-
41
<div class="sidebar-donate">
5-
<a href="https://numfocus.org/donate-to-matplotlib" target="_blank">
6-
<span class="mpl-button" >Support Matplotlib</span>
7-
</a>
8-
</div>
2+
<a class="sd-btn sd-btn-primary sd-fs-5 sd-px-5 sd-py-2" href="https://numfocus.org/donate-to-matplotlib" target="_blank">
3+
Support Matplotlib
4+
</a>
5+
</div>

mpl_sphinx_theme/static/css/style.css

+4-5
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ html[data-theme="dark"] {
1414
}
1515

1616
:root {
17-
--pst-color-link-hover: var(--pst-color-secondary);
17+
--pst-color-link-hover: var(--pst-color-secondary);
1818
}
1919

20-
.sidebar-cheatsheets, .sidebar-donate {
21-
margin: 2.75rem 0;
20+
.sidebar-donate > .sd-btn {
21+
width: 100%;
2222
}
2323

2424
#navbar-icon-links {
25-
margin-left: 1.5em;
25+
margin-left: 1.5em;
2626
}
2727

2828
#navbar-icon-links .nav-link {
@@ -32,4 +32,3 @@ html[data-theme="dark"] {
3232
#navbar-icon-links .nav-link:hover {
3333
color: var(--pst-color-primary);
3434
}
35-

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ classifiers = [
2121
dependencies = [
2222
"pydata-sphinx-theme>=0.13.1",
2323
"matplotlib",
24+
"sphinx-design",
2425
]
2526

2627
[project.urls]

0 commit comments

Comments
 (0)