Skip to content

Commit

Permalink
Remove Google search and replace it with Mkdocs
Browse files Browse the repository at this point in the history
This change updates the modal to use MkDocs for search.
  • Loading branch information
d0ugal committed May 31, 2015
1 parent eae9390 commit 33666c4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
24 changes: 9 additions & 15 deletions docs_theme/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,19 @@
<div class="container-fluid">

<!-- Search Modal -->
<div id="searchModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div id="mkdocs_search_modal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3 id="myModalLabel">Documentation search</h3>
</div>

<div class="modal-body">
<!-- Custom google search -->
<script>
(function() {
var cx = '015016005043623903336:rxraeohqk6w';
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>
<form role="form">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search..." id="mkdocs-search-query">
</div>
</form>
<div id="mkdocs-search-results"></div>
</div>

<div class="modal-footer">
Expand Down Expand Up @@ -176,6 +168,8 @@ <h3 id="myModalLabel">Documentation search</h3>
<script src="{{ base_url }}/js/prettify-1.0.js"></script>
<script src="{{ base_url }}/js/bootstrap-2.1.1-min.js"></script>
<script src="{{ base_url }}/js/theme.js"></script>
<script>var base_url = '{{ base_url }}';</script>
<script data-main="{{ base_url }}/mkdocs/js/search.js" src="{{ base_url }}/mkdocs/js/require.js"></script>

<script>
//$('.side-nav').scrollspy()
Expand Down
4 changes: 4 additions & 0 deletions docs_theme/css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -415,3 +415,7 @@ ul.sponsor {
list-style: none;
display: block;
}

#mkdocs_search_modal article p{
word-wrap: break-word;
}
2 changes: 1 addition & 1 deletion docs_theme/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<a class="repo-link btn btn-inverse btn-small {% if not previous_page %}disabled{% endif %}" rel="next" {% if previous_page %}href="{{ previous_page.url }}"{% endif %}>
<i class="icon-arrow-left icon-white"></i> Previous
</a>
<a class="repo-link btn btn-inverse btn-small" href="#searchModal" data-toggle="modal"><i class="icon-search icon-white"></i> Search</a>
<a class="repo-link btn btn-inverse btn-small" href="#mkdocs_search_modal" data-toggle="modal" data-target="#mkdocs_search_modal"><i class="icon-search icon-white"></i> Search</a>
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
Expand Down

0 comments on commit 33666c4

Please sign in to comment.