Configuring Sphinx to avoid creating a search box

Is there an easy way (i.e. without creating a completely new theme) to configure Sphinx to generate HTML pages without a search box?

+5
source share
2 answers

You can do this by setting up (or should I say disable) the search pattern.

  • In conf.py add this line:

    templates_path = ["templates"] 
  • Create a folder called templates in the Sphinx project directory.

  • In this folder, add an empty file named searchbox.html . This overrides the default template file (located in sphinx/themes/basic where Sphinx is installed).

+6
source

An alternative that I found by reading the alabaster topic should explicitly indicate which (if any sidebars) are desired in the conf.py file. For example, including this snippet in conf.py :

 html_theme = 'alabaster' html_sidebars = { '**': [ 'about.html', 'navigation.html', 'searchbox.html', ] } 

Creates a search field removing searchbox.html from this list and then will create the same page, but without it. (For more information, see the Sphinx documentation for the assembly configuration file .)

+4
source

All Articles