File tree Expand file tree Collapse file tree 6 files changed +32
-7
lines changed
Expand file tree Collapse file tree 6 files changed +32
-7
lines changed Original file line number Diff line number Diff line change 4444html_theme = "mpl_sphinx_theme"
4545html_favicon = "_static/favicon.ico"
4646html_theme_options = {
47- "logo" : {"link" : "https://matplotlib.org/stable/" ,
48- "image_light" : "images/logo2.svg" ,
49- "image_dark" : "images/logo_dark.svg" },
47+ # logo is installed by mpl-sphinx-theme as:
48+ # "logo": {"link": "https://matplotlib.org/stable/",
49+ # "image_light": "_static/logo2.svg",
50+ # "image_dark": "_static/logo_dark.svg"},
51+ # if this default is OK, then no need to modify "logo"
5052 # collapse_navigation in pydata-sphinx-theme is slow, so skipped for local
5153 # and CI builds https://github.com/pydata/pydata-sphinx-theme/pull/386
5254 "collapse_navigation" : not is_release_build ,
6264# Add any paths that contain custom static files (such as style sheets) here,
6365# relative to this directory. They are copied after the builtin static files,
6466# so a file named "default.css" will overwrite the builtin "default.css".
65- # html_static_path = ["static "]
67+ # html_static_path = ["_static "]
Original file line number Diff line number Diff line change 1- pydata-sphinx-theme >= 0.10.0
1+ pydata-sphinx-theme >= 0.13.1
22matplotlib
Original file line number Diff line number Diff line change 33from pathlib import Path
44
55
6+ def set_config_defaults (app ):
7+
8+ try :
9+ theme = app .builder .theme_options
10+ except AttributeError :
11+ theme = None
12+ if not theme :
13+ theme = {}
14+
15+ # Default logo
16+ logo = theme .get ("logo" , {})
17+ if "image_dark" not in logo :
18+ logo ["image_dark" ] = "_static/logo_dark.svg"
19+ if "image_light" not in logo :
20+ logo ["image_light" ] = "_static/logo2.svg"
21+ if "link" not in logo :
22+ logo ["link" ] = "https://matplotlib.org/stable/"
23+ theme ["logo" ] = logo
24+
25+ # Update the HTML theme config
26+ app .builder .theme_options = theme
27+
28+
629def get_html_theme_path ():
730 """Return list of HTML theme paths."""
831 return [str (Path (__file__ ).parent .parent .resolve ())]
@@ -34,7 +57,7 @@ def setup(app):
3457 here = Path (__file__ ).parent .resolve ()
3558 # Include component templates
3659 app .config .templates_path .append (str (here / "components" ))
37-
3860 app .add_html_theme ("mpl_sphinx_theme" , str (here ))
61+ app .connect ("builder-inited" , set_config_defaults )
3962 app .connect ("html-page-context" , setup_html_page_context )
4063 return {'version' : __version__ , 'parallel_read_safe' : True }
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 1- pydata-sphinx-theme >= 0.11.0
1+ pydata-sphinx-theme >= 0.13.1
22matplotlib
You can’t perform that action at this time.
0 commit comments