Skip to content

Commit

Permalink
Add a flag to disable docsearch (#4570)
Browse files Browse the repository at this point in the history
* Add a flag to disable docsearch

* Disable Docsearch with a feature on READTHEDOCS_DATA

* Make the comment clearer

* Checkin compiled built assets
  • Loading branch information
davidfischer committed Aug 25, 2018
1 parent 0449b32 commit 4bd8656
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions readthedocs/core/static-src/core/js/doc-embed/search.js
Expand Up @@ -109,9 +109,13 @@ function attach_elastic_search_query(data) {
};

if (typeof Search !== 'undefined' && project && version) {
var query_fallback = Search.query;
Search.query_fallback = query_fallback;
Search.query = query_override;

// Do not replace the built-in search if RTD's docsearch is disabled
if (!data.features || !data.features.docsearch_disabled) {
var query_fallback = Search.query;
Search.query_fallback = query_fallback;
Search.query = query_override;
}
}
$(document).ready(function () {
if (typeof Search !== 'undefined') {
Expand Down

0 comments on commit 4bd8656

Please sign in to comment.