Bug 1730515 - FX doc: Use google search instead of sphinx search r=firefox-source-docs-reviewers,ahal DONTBUILD

sphinx search is pretty bad...

Differential Revision: https://phabricator.services.mozilla.com/D128022
This commit is contained in:
Sylvestre Ledru
2022-03-03 08:25:29 +00:00
parent 91fbdb0957
commit 7e17c026f8
2 changed files with 23 additions and 0 deletions

16
docs/_templates/searchbox.html vendored Normal file
View File

@@ -0,0 +1,16 @@
<! -- This code is governed by the BSD license -->
<div>
<h3>{{ _('Quick search') }}</h3>
<script>
(function() {
var cx = 'dd12886298f75dbef';
var gcse = document.createElement('script');
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search></gcse:search>
</div>

View File

@@ -70,6 +70,13 @@ templates_path = ["_templates"]
source_suffix = [".rst", ".md"]
master_doc = "index"
project = "Firefox Source Docs"
# Override the search box to use Google instead of
# sphinx search
html_sidebars = {
"**": [
"searchbox.html",
]
}
html_logo = os.path.join(
topsrcdir, "browser/branding/nightly/content/firefox-wordmark.svg"
)