Merge branch 'doc-google-custom-search' into develop

This commit is contained in:
Seth House 2014-04-17 00:06:00 -06:00
commit a133c15e77
2 changed files with 26 additions and 9 deletions

15
doc/_templates/googlesearch.html vendored Normal file
View 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 %}

View File

@ -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 = [