PSphinxTheme.ext.sidebarlogo_perpag

Overview

override sphinx sidebar logo per-page

This extension adds an option to set different sidebar logo per-page.

Configuration

This extension reads the following conf.py options:

sidebarlogo_perpage_dict: a glob map (ala html_sidebars), used to change sidebar logo per-page

Important

  • any image must be in the path: html_static_path
  • do not prefix any image files with a extra path: only use the file name

FORMAT:

  • keys: (None or image name string) e.g.: ‘P-SphinxTheme180_95_bg.png’
  • value: (list or set of html pages): e.g.: [‘index’, ‘copyright’], set({‘index’, ‘copyright’})

For example, the following snippet uses:

  • uses a general sidebar logo: _static/P-SphinxTheme180_95_logo.png
  • for the index page and the copyright page: it does not use any sidebar logo
  • for the main_theme page and history: is uses the sidebar logo _static/P-SphinxTheme180_95_bg.png

conf.py Usage Example:

# The name of an image file (relative to this directory) to place at the top of the sidebar.
html_logo = 'P-SphinxTheme180_95_logo.png'

# modify logo per page: using: P-Sphinx Theme extension: sidebarlogo_perpag
sidebarlogo_perpage_dict = {
   None: set({'index', 'copyright'}),
   'P-SphinxTheme180_95_bg.png': set({'main_theme', 'history'})
}