Skip to content

Commit 0cb2523

Browse files
authored
Update docs search plugin (#6810)
1 parent a4c2d4f commit 0cb2523

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

docs_theme/js/theme.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ var getSearchTerm = function() {
99
}
1010
};
1111

12-
var initilizeSearch = function() {
13-
require.config({ baseUrl: '/mkdocs/js' });
14-
require(['search']);
15-
};
16-
1712
$(function() {
1813
var searchTerm = getSearchTerm(),
1914
$searchModal = $('#mkdocs_search_modal'),
@@ -30,6 +25,5 @@ $(function() {
3025

3126
$searchModal.on('shown', function() {
3227
$searchQuery.focus();
33-
initilizeSearch();
3428
});
3529
});

docs_theme/main.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,17 @@ <h3 id="myModalLabel">Documentation search</h3>
138138
<!-- Le javascript
139139
================================================== -->
140140
<!-- Placed at the end of the document so the pages load faster -->
141+
<script async src="https://fund.django-rest-framework.org/sidebar_include.js"></script>
141142
<script src="{{ base_url }}/js/jquery-1.8.1-min.js"></script>
142143
<script src="{{ base_url }}/js/prettify-1.0.js"></script>
143144
<script src="{{ base_url }}/js/bootstrap-2.1.1-min.js"></script>
144-
<script async src="https://fund.django-rest-framework.org/sidebar_include.js"></script>
145-
<script>var base_url = '{{ base_url }}';</script>
146-
<script src="{{ base_url }}/mkdocs/js/require.js"></script>
147145
<script src="{{ base_url }}/js/theme.js"></script>
148146

147+
<script>var base_url = '{{ base_url }}';</script>
148+
{% for path in config.extra_javascript %}
149+
<script src="{{ path|url }}" defer></script>
150+
{% endfor %}
151+
149152
<script>
150153
var shiftWindow = function() {
151154
scrollBy(0, -50)

0 commit comments

Comments
 (0)