mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge branch 'doc-google-custom-search' into develop
This commit is contained in:
commit
a133c15e77
15
doc/_templates/googlesearch.html
vendored
Normal file
15
doc/_templates/googlesearch.html
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
{%- if pagename != "search" and builder != "singlehtml" %}
|
||||
<script>
|
||||
(function() {
|
||||
var cx = '001322401757093273933:ufrvy56oa_a';
|
||||
var gcse = document.createElement('script');
|
||||
gcse.type = 'text/javascript';
|
||||
gcse.async = true;
|
||||
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
|
||||
'//www.google.com/cse/cse.js?cx=' + cx;
|
||||
var s = document.getElementsByTagName('script')[0];
|
||||
s.parentNode.insertBefore(gcse, s);
|
||||
})();
|
||||
</script>
|
||||
<gcse:search></gcse:search>
|
||||
{%- endif %}
|
20
doc/conf.py
20
doc/conf.py
@ -107,7 +107,6 @@ import salt.version
|
||||
|
||||
|
||||
formulas_dir = os.path.join(os.pardir, docs_basepath, 'formulas')
|
||||
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
||||
|
||||
# ----- Intersphinx Settings ------------------------------------------------>
|
||||
intersphinx_mapping = {
|
||||
@ -167,12 +166,10 @@ extlinks = {
|
||||
locale_dirs = ['locale/']
|
||||
gettext_compact = False
|
||||
# <---- Localization ---------------------------------------------------------
|
||||
### HTML options
|
||||
if on_rtd:
|
||||
html_theme = 'default'
|
||||
else:
|
||||
html_theme = 'saltstack'
|
||||
|
||||
|
||||
### HTML options
|
||||
html_theme = 'saltstack'
|
||||
html_theme_path = ['_themes']
|
||||
html_title = None
|
||||
html_short_title = 'Salt'
|
||||
@ -182,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',
|
||||
}
|
||||
@ -190,7 +193,7 @@ html_default_sidebars = [
|
||||
'localtoc.html',
|
||||
'relations.html',
|
||||
'sourcelink.html',
|
||||
'searchbox.html',
|
||||
html_search_template,
|
||||
]
|
||||
html_sidebars = {
|
||||
'ref/**/all/salt.*': [
|
||||
@ -198,7 +201,7 @@ html_sidebars = {
|
||||
'localtoc.html',
|
||||
'relations.html',
|
||||
'sourcelink.html',
|
||||
'searchbox.html',
|
||||
html_search_template,
|
||||
],
|
||||
'ref/formula/all/*': [
|
||||
],
|
||||
@ -216,7 +219,6 @@ html_last_updated_fmt = '%b %d, %Y'
|
||||
html_show_sourcelink = False
|
||||
html_show_sphinx = True
|
||||
html_show_copyright = True
|
||||
html_use_opensearch = 'http://docs.saltstack.com'
|
||||
|
||||
### Latex options
|
||||
latex_documents = [
|
||||
|
Loading…
Reference in New Issue
Block a user