From a76934ad3344def0f4559c1a149f7422afc86dd4 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 24 Sep 2020 19:40:28 +0200 Subject: [PATCH] docs: html: adapt sidebar in index page Signed-off-by: Thomas Lamprecht --- docs/_templates/index-sidebar.html | 11 +++++++++++ docs/_templates/sidebar-header.html | 6 ++++++ docs/conf.py | 22 ++++++++++++++++++---- 3 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 docs/_templates/index-sidebar.html create mode 100644 docs/_templates/sidebar-header.html diff --git a/docs/_templates/index-sidebar.html b/docs/_templates/index-sidebar.html new file mode 100644 index 00000000..45e0635c --- /dev/null +++ b/docs/_templates/index-sidebar.html @@ -0,0 +1,11 @@ +

Navigation

+{{ toctree(includehidden=theme_sidebar_includehidden, collapse=True, titles_only=True) }} +{% if theme_extra_nav_links %} +
+

Links

+ +{% endif %} diff --git a/docs/_templates/sidebar-header.html b/docs/_templates/sidebar-header.html new file mode 100644 index 00000000..c695c856 --- /dev/null +++ b/docs/_templates/sidebar-header.html @@ -0,0 +1,6 @@ + +
diff --git a/docs/conf.py b/docs/conf.py index 1666a354..fc1631c2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -181,6 +181,24 @@ html_theme_options = { 'font_family': 'Open Sans, sans-serif', } +# Alabaster theme recommends setting this fixed. +# If you switch theme this needs to removed, probably. +html_sidebars = { + '**': [ + 'sidebar-header.html', + 'searchbox.html', + 'navigation.html', + 'relations.html', + ], + + 'index': [ + 'sidebar-header.html', + 'searchbox.html', + 'index-sidebar.html', + ] +} + + # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] @@ -226,10 +244,6 @@ html_static_path = ['_static'] # # html_use_smartypants = True -# Custom sidebar templates, maps document names to template names. -# -# html_sidebars = {} - # Additional templates that should be rendered to pages, maps page names to # template names. #