mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add environment variable check to switch search providers
Using Google's search is an opt-in. Defaults to Sphinx-native search.
This commit is contained in:
parent
2c659f033b
commit
b01bf7cab0
1 changed files with 8 additions and 2 deletions
10
doc/conf.py
10
doc/conf.py
|
@ -179,6 +179,12 @@ html_logo = None # specfied in the theme layout.html
|
|||
html_favicon = 'favicon.ico'
|
||||
html_use_smartypants = False
|
||||
|
||||
# Use Google customized search or use Sphinx built-in JavaScript search
|
||||
if 'SALT_GOOGLE_SEARCH' in os.environ:
|
||||
html_search_template = 'googlesearch.html'
|
||||
else:
|
||||
html_search_template = 'searchbox.html'
|
||||
|
||||
html_additional_pages = {
|
||||
'404': '404.html',
|
||||
}
|
||||
|
@ -187,7 +193,7 @@ html_default_sidebars = [
|
|||
'localtoc.html',
|
||||
'relations.html',
|
||||
'sourcelink.html',
|
||||
'searchbox.html',
|
||||
html_search_template,
|
||||
]
|
||||
html_sidebars = {
|
||||
'ref/**/all/salt.*': [
|
||||
|
@ -195,7 +201,7 @@ html_sidebars = {
|
|||
'localtoc.html',
|
||||
'relations.html',
|
||||
'sourcelink.html',
|
||||
'searchbox.html',
|
||||
html_search_template,
|
||||
],
|
||||
'ref/formula/all/*': [
|
||||
],
|
||||
|
|
Loading…
Add table
Reference in a new issue