Skip to content

Commit

Permalink
Use template to set sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
ConorMacBride committed Sep 14, 2022
1 parent 75a8ced commit 8ff8b33
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
exclude_assets: '.buildinfo'
exclude_assets: '.buildinfo,_static/jquery-*.js,_static/underscore-*.js'
destination_dir: ./latest
keep_files: false
full_commit_message: Deploy latest to GitHub Pages
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ __pycache__
build
dist
.tmp
.DS_Store
/docs/sample
/docs/_build
8 changes: 8 additions & 0 deletions docs/_templates/mpl_third_party_sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<nav class="bd-links" id="bd-docs-nav" aria-label="{{ _('Site navigation') }}">
<p class="bd-links__title" role="heading" aria-level="1">
<a href="{{ pathto('index') }}">{{ project }} Documentation</a>
</p>
<div class="bd-toc-item navbar-nav">
{{ generate_toctree_html("sidebar", startdepth=0, maxdepth=1, collapse=True, includehidden=True, titles_only=True) }}
</div>
</nav>
12 changes: 8 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
# ones.
extensions = [
'sample_summaries',
'sidebar',
'sphinx_design',
]

Expand All @@ -58,13 +57,18 @@
#
html_theme = "mpl_sphinx_theme"
html_theme_options = {
"native_site": False,
"navbar_links": "absolute",
"show_prev_next": False,
"logo": {"image_light": "images/logo2.svg",
"logo": {"link": "https://matplotlib.org/stable/",
"image_light": "images/logo2.svg",
"image_dark": "images/logo_dark.svg"},
"collapse_navigation": False,
}
html_sidebars = {
"**": ["mpl_third_party_sidebar.html", "sidebar-nav-bs.html"]
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# html_static_path = ['_static']
1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
.. module:: pytest-mpl

.. toctree::
:caption: pytest-mpl Documentation
:hidden:

installing
Expand Down
44 changes: 0 additions & 44 deletions docs/sidebar.py

This file was deleted.

0 comments on commit 8ff8b33

Please sign in to comment.